diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/Test.json b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/Test.json index 14772064daefabc0d8b11e19e5051a49b70c8ecb..fd7b801213dc59a5a2285bd60b1be99700ca3345 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/Test.json +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/Test.json @@ -5,7 +5,7 @@ "test-timeout": "600000", "bundle-name": "com.example.actsgetabilitystatestagetest", "module-name": "entry", - "shell-timeout": "600000" + "shell-timeout": "10000" }, "kits": [ { diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility2/MainAbility2.ts index f30966b58db9e143e272afddb7600ef2fc5161a0..0a9d781246d55b46aa5945b40b6ce777b40b3af6 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility2/MainAbility2.ts @@ -14,6 +14,10 @@ */ import Ability from '@ohos.app.ability.UIAbility' +import commonEvent from '@ohos.commonEvent' +function publishCallBackOne() { + console.log("====MainAbility2 Publish CallBack GetCurrentTopAbility"); +} export default class MainAbility extends Ability { onCreate(want, launchParam) { @@ -27,9 +31,15 @@ export default class MainAbility extends Ability { onWindowStageCreate(windowStage) { // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) + console.log("[Demo] MainAbility onWindowStageCreate"); + windowStage.setUIContent(this.context, "pages/index", null); + windowStage.on('windowStageEvent', (data) => { + console.log(`ActsGetAbilityStatestAgeTest onWindwoStageMainAbilty2 is : ${JSON.stringify(data)}`); + if (data == 2 ) { + console.log(`ActsGetAbilityStatestAgeTest getWindowStageActiveMainAbility2 is sucess`); + commonEvent.publish("GetCurrentTopAbility", publishCallBackOne); + } + }) } onWindowStageDestroy() { diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility3/MainAbility3.ts b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility3/MainAbility3.ts index 3686c226201725bf2a20dbc8f966b0c082e38b5a..db7df22fe9b8067bf9420ffa756c2aee92f611d2 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility3/MainAbility3.ts +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility3/MainAbility3.ts @@ -14,6 +14,11 @@ */ import Ability from '@ohos.app.ability.UIAbility' +import commonEvent from '@ohos.commonEvent' + +function publishCallBackOne() { + console.log("====MainAbility3 Publish CallBack GetCurrentTopAbility"); +} export default class MainAbility3 extends Ability { onCreate(want, launchParam) { @@ -27,9 +32,16 @@ export default class MainAbility3 extends Ability { onWindowStageCreate(windowStage) { // Main window is created, set main page for this ability - console.log("MainAbility3 onWindowStageCreate") - windowStage.setUIContent(this.context, "pages/index", null) + console.log("MainAbility3 onWindowStageCreate"); + windowStage.setUIContent(this.context, "pages/index", null); globalThis.ability3Context = this.context; + windowStage.on('windowStageEvent', (data) => { + console.log(`ActsGetAbilityStatestAgeTest onWindwoStageMainAbilty3 is : ${JSON.stringify(data)}`); + if (data == 2 ) { + console.log(`ActsGetAbilityStatestAgeTest getWindowStageActiveMainAbility3 is sucess`); + commonEvent.publish("GetCurrentTopAbility", publishCallBackOne); + } + }) } onWindowStageDestroy() { diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility4/MainAbility4.ts b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility4/MainAbility4.ts index 16982b8a70c2069a2f0b78643e15252cf4eb5e53..d1d168ea0b725315f7cff649acc264af82e646a9 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility4/MainAbility4.ts +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility4/MainAbility4.ts @@ -13,7 +13,11 @@ * limitations under the License. */ import Ability from '@ohos.app.ability.UIAbility' +import commonEvent from '@ohos.commonEvent' +function publishCallBackOne() { + console.debug("====MainAbility4 Publish CallBack GetCurrentTopAbility"); +} export default class MainAbility4 extends Ability { onCreate(want, launchParam) { @@ -27,10 +31,16 @@ export default class MainAbility4 extends Ability { onWindowStageCreate(windowStage) { // Main window is created, set main page for this ability - console.log("MainAbility4 onWindowStageCreate") - windowStage.setUIContent(this.context, "pages/index", null) + console.log("MainAbility4 onWindowStageCreate"); + windowStage.setUIContent(this.context, "pages/index", null); globalThis.ability4Context = this.context; - //commonEvent.publish("ACTS_GetAppContext", PublishCallBackOne4); + windowStage.on('windowStageEvent', (data) => { + console.log(`ActsGetAbilityStatestAgeTest onWindwoStageMainAbilty4 is : ${JSON.stringify(data)}`); + if (data == 2 ) { + console.log(`ActsGetAbilityStatestAgeTest getWindowStageActiveMainAbility4 is sucess`); + commonEvent.publish("GetCurrentTopAbility", publishCallBackOne); + } + }) } onWindowStageDestroy() { diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/test/Ability.test.ets index d3b071b019583962df1a9f86277bdd2e9b2f700f..e744cca43f359c822178834bef36a9dfb4300821 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/test/Ability.test.ets @@ -15,8 +15,11 @@ */ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -const START_ABILITY_TIMEOUT = 4000; +import commonEvent from "@ohos.commonEvent" +let subscriberInfo_MainAbility = { + events: ["GetCurrentTopAbility"], +}; export default function abilityTest() { describe('ActsGetAbilityStateStageTest', function () { @@ -26,31 +29,44 @@ export default function abilityTest() { * @tc.desc : Get the status of the Ability in the BACKGROUND state */ it('ACTS_GetAbilityState_0200', 0, async function (done) { - console.debug('====>start ACTS_GetAbilityState_0200===='); - var flag = true; - var ability; - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + console.log('====>start ACTS_GetAbilityState_0200===='); + let ability; + let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let count = 0; + let subscriber; function onAbilityForegroundCallback2(){ - console.debug("====>onAbilityForegroundCallback2===="); - abilityDelegator.getCurrentTopAbility((err, data)=>{ - console.debug("====>getCurrentTopAbility_0200 err:" + JSON.stringify(err) + " data:" + JSON.stringify(data)); + console.log("====>onAbilityForegroundCallback2===="); + count ++; + if (count == 2) { + abilityDelegator.getCurrentTopAbility((err, data)=>{ + console.log("====>getCurrentTopAbility_0200 err:" + JSON.stringify(err) + " data:" + JSON.stringify(data)); ability = data; abilityDelegator.doAbilityBackground(ability, (err)=>{ - console.debug("====>doAbilityBackground_0200 data:" + JSON.stringify(err)); + console.log("====>doAbilityBackground_0200 data:" + JSON.stringify(err)); expect(err.code).assertEqual(0); }) }) + } } function onAbilityBackgroundCallback2(){ - console.debug("====>onAbilityBackgroundCallback2===="); - var state = abilityDelegator.getAbilityState(ability); - console.debug("====>ACTS_GetAbilityState_0200 state:" + state); + console.log("====>onAbilityBackgroundCallback2===="); + let state = abilityDelegator.getAbilityState(ability); + console.log("====>ACTS_GetAbilityState_0200 state:" + state); expect(state).assertEqual(AbilityDelegatorRegistry.AbilityLifecycleState.BACKGROUND); - console.debug("====>ACTS_GetAbilityState_0200 end===="); - flag=false; - done(); + console.log("====>ACTS_GetAbilityState_0200 end===="); + commonEvent.unsubscribe(subscriber, UnSubscribeCallback); } + commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { + console.log("ACTS_GetAbilityState_0200====>Create Subscriber====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, onAbilityForegroundCallback2); + }) + + function UnSubscribeCallback() { + console.log("ACTS_GetAbilityState_0200====>UnSubscribe CallBack====>"); + done(); + } abilityDelegator.addAbilityMonitor( {abilityName: 'MainAbility2', @@ -58,24 +74,15 @@ export default function abilityTest() { onAbilityBackground:onAbilityBackgroundCallback2 } ).then(()=>{ - console.debug("====>addAbilityMonitor_0200 finish===="); + console.log("====>addAbilityMonitor_0200 finish===="); globalThis.abilityContext.startAbility( { bundleName: 'com.example.actsgetabilitystatestagetest', abilityName: 'MainAbility2', }, (err)=>{ - console.debug("====>startAbility_0200 err:" + JSON.stringify(err)); + console.log("====>startAbility_0200 err:" + JSON.stringify(err)); }) }) - - setTimeout(()=>{ - if(flag==true){ - console.debug("====>in timeout 0200===="); - expect().assertFail(); - done(); - } - },START_ABILITY_TIMEOUT) - }) /* @@ -84,46 +91,54 @@ export default function abilityTest() { * @tc.desc : Get the status of the Ability in the FOREGROUND state */ it('ACTS_GetAbilityState_0300', 0, async function (done) { - console.debug('====>start ACTS_GetAbilityState_0300===='); - var flag = true; - var ability; - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + console.log('====>start ACTS_GetAbilityState_0300===='); + let ability; + let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let count = 0; + let subscriber; function onAbilityForegroundCallback3(){ - console.debug("====>onAbilityForegroundCallback3===="); - abilityDelegator.getCurrentTopAbility((err, data)=>{ - console.debug("====>getCurrentTopAbility_0300 err:" + JSON.stringify(err) + "data:" + JSON.stringify(data)); + console.log("====>onAbilityForegroundCallback3===="); + count++; + if (count == 2) { + abilityDelegator.getCurrentTopAbility((err, data)=>{ + console.log("====>getCurrentTopAbility_0300 err:" + JSON.stringify(err) + "data:" + JSON.stringify(data)); ability = data; - var state = abilityDelegator.getAbilityState(ability); - console.debug("====>ACTS_GetAbilityState_0300 state:" + state); + let state = abilityDelegator.getAbilityState(ability); + console.log("====>ACTS_GetAbilityState_0300 state:" + state); expect(state).assertEqual(AbilityDelegatorRegistry.AbilityLifecycleState.FOREGROUND); - expect(state != AbilityDelegatorRegistry.AbilityLifecycleState.CREATE).assertTrue() - expect(state != AbilityDelegatorRegistry.AbilityLifecycleState.DESTROY).assertTrue() + expect(state != AbilityDelegatorRegistry.AbilityLifecycleState.CREATE).assertTrue(); + expect(state != AbilityDelegatorRegistry.AbilityLifecycleState.DESTROY).assertTrue(); abilityDelegator.doAbilityBackground(ability, (err)=>{ - console.debug("====>doAbilityBackground_0300 data:" + JSON.stringify(err)); + console.log("====>doAbilityBackground_0300 data:" + JSON.stringify(err)); expect(err.code).assertEqual(0); - console.debug("====>ACTS_GetAbilityState_0300 end===="); - flag=false; - done(); + console.log("====>ACTS_GetAbilityState_0300 end===="); + commonEvent.unsubscribe(subscriber, UnSubscribeCallback); }) }) - } - setTimeout(()=>{ - if(flag==true){ - console.debug("====>in timeout 0300===="); - expect().assertFail(); - done(); } - },START_ABILITY_TIMEOUT) + } + + commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { + console.log("ACTS_GetAbilityState_0300====>Create Subscriber====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, onAbilityForegroundCallback3); + }) + + function UnSubscribeCallback() { + console.log("ACTS_GetAbilityState_0300====>UnSubscribe CallBack====>"); + done(); + } + abilityDelegator.addAbilityMonitor( {abilityName: 'MainAbility3', onAbilityForeground:onAbilityForegroundCallback3}).then(()=>{ - console.debug("====>addAbilityMonitor_0300 finish===="); + console.log("====>addAbilityMonitor_0300 finish===="); globalThis.abilityContext.startAbility( { bundleName: 'com.example.actsgetabilitystatestagetest', abilityName: 'MainAbility3', }, (err)=>{ - console.debug("====>startAbility_0300 err:" + JSON.stringify(err)); + console.log("====>startAbility_0300 err:" + JSON.stringify(err)); }) }) }) @@ -134,13 +149,13 @@ export default function abilityTest() { * @tc.desc : Get the status of an inactive or nonexistent Ability */ it('ACTS_GetAbilityState_0500', 0, async function (done) { - console.debug('====>start ACTS_GetAbilityState_0500===='); - var ability = Object.create(null); - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - var state = abilityDelegator.getAbilityState(ability); - console.debug("====>ACTS_GetAppState_0500 state:" + state); + console.log('====>start ACTS_GetAbilityState_0500===='); + let ability = Object.create(null); + let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let state = abilityDelegator.getAbilityState(ability); + console.log("====>ACTS_GetAppState_0500 state:" + state); expect(state).assertEqual(undefined); - console.debug("====>ACTS_GetAbilityState_0500 end===="); + console.log("====>ACTS_GetAbilityState_0500 end===="); done(); }) @@ -150,49 +165,56 @@ export default function abilityTest() { * @tc.desc : Get the status of the Ability in the uninitialized state */ it('ACTS_GetAbilityState_0600', 0, async function (done) { - console.debug('====>start ACTS_GetAbilityState_0600====') - var flag = true; - var ability; - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + console.log('====>start ACTS_GetAbilityState_0600===='); + let ability; + let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let count = 0; + let subscriber; function onAbilityForegroundCallback6(){ - console.debug("====>onAbilityForegroundCallback6===="); - abilityDelegator.getCurrentTopAbility((err, data)=>{ - console.debug("====>getCurrentTopAbility_0600 err:" + JSON.stringify(err) + "data:" + JSON.stringify(data)); + console.log("====>onAbilityForegroundCallback6===="); + count++; + if (count == 2) { + abilityDelegator.getCurrentTopAbility((err, data)=>{ + console.log("====>getCurrentTopAbility_0600 err:" + JSON.stringify(err) + "data:" + JSON.stringify(data)); ability = data; globalThis.ability4Context.terminateSelf(); - }) + }) + } } function onAbilityDestroyCallback6(){ - console.debug("====>onAbilityDestroyCallback6===="); - var state = abilityDelegator.getAbilityState(ability); - console.debug("====>ACTS_GetAbilityState_0600 data:" + state); - console.debug("====>UNINITIALIZED:"+ AbilityDelegatorRegistry.AbilityLifecycleState.UNINITIALIZED); + console.log("====>onAbilityDestroyCallback6===="); + let state = abilityDelegator.getAbilityState(ability); + console.log("====>ACTS_GetAbilityState_0600 data:" + state); + console.log("====>UNINITIALIZED:"+ AbilityDelegatorRegistry.AbilityLifecycleState.UNINITIALIZED); expect(state).assertEqual(AbilityDelegatorRegistry.AbilityLifecycleState.UNINITIALIZED); - console.debug("====>ACTS_GetAbilityState_0600 end===="); - flag=false; - done(); + console.log("====>ACTS_GetAbilityState_0600 end===="); + commonEvent.unsubscribe(subscriber, UnSubscribeCallback); } - setTimeout(()=>{ - if(flag==true){ - console.debug("====>in timeout 0600==="); - expect().assertFail(); - done(); - } - },START_ABILITY_TIMEOUT) + + commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { + console.log("ACTS_GetAbilityState_0600====>Create Subscriber====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, onAbilityForegroundCallback6); + }) + + function UnSubscribeCallback() { + console.log("ACTS_GetAbilityState_0600====>UnSubscribe CallBack====>"); + done(); + } + abilityDelegator.addAbilityMonitor( {abilityName: 'MainAbility4', onAbilityForeground:onAbilityForegroundCallback6, onAbilityDestroy:onAbilityDestroyCallback6}).then(()=>{ - console.debug("====>addAbilityMonitor_0600 finish===="); + console.log("====>addAbilityMonitor_0600 finish===="); globalThis.abilityContext.startAbility( { bundleName: 'com.example.actsgetabilitystatestagetest', abilityName: 'MainAbility4', }, (err)=>{ - console.debug("====>startAbility_0600 err:" + JSON.stringify(err)); + console.log("====>startAbility_0600 err:" + JSON.stringify(err)); }) }) - }) }) } \ No newline at end of file diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/ets/Ability1/Ability1.ts b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/ets/Ability1/Ability1.ts index bb7ab237930ac0e040e63c455d5041b312ddda2b..ea11ae24a115a0c9567172fb9410cccf7ac88512 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/ets/Ability1/Ability1.ts +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/ets/Ability1/Ability1.ts @@ -36,6 +36,13 @@ export default class MainAbility extends Ability { globalThis.ability3Context = this.context windowStage.setUIContent(this.context, "pages/index1", null) + windowStage.on('windowStageEvent', (data) => { + console.log(`ActsGetCurrentTopAbilityStagebTest onWindwoStage is : ${JSON.stringify(data)}`) + if (data == 2 ) { + console.log(`ActsGetCurrentTopAbilityStagebTest getWindowStageActive is sucess`) + commonEvent.publish("GetCurrentTopAbility", publishCallBackOne); + } + }) } onWindowStageDestroy() { @@ -46,7 +53,6 @@ export default class MainAbility extends Ability { onForeground() { // Ability has brought to foreground console.log("Ability1 onForeground") - commonEvent.publish("GetCurrentTopAbility", publishCallBackOne); } diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets index 40f48bf026eea0b1d19909cbfa28790de7a50f49..a53c1450f83e3d796da5ce13d481b38af5990a77 100644 --- a/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets @@ -28,6 +28,11 @@ var osAccountManager const START_ABILITY_TIMEOUT = 10000; console.debug("====>in Ability.test====>"); export default function abilityTest() { + + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + console.debug("====>in function abilityTest====>"); describe('ActsInterfaceMultiUsersTest', function () { // afterAll(function() { @@ -135,44 +140,20 @@ export default function abilityTest() { * @tc.desc : Start an ability with the parameter startability with options failed.(promise) */ it('ACTS_startAbility_2200', 0, async function (done) { - let TAG = 'ACTS_startAbility_2200' - let Subscriber - function SubscribeCallBack (err, data) { - expect().assertFail(); - console.debug(TAG + "====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(subscriberInfo_MainAbility).then((data) => { - console.debug(TAG + "====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug(TAG + "====>start startAbility====>"); - await globalThis.abilityContext.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility2' - }, { - windowMode:0 - }).then(()=>{ - console.debug(TAG + "====>startAbility end====>"); - }) - }) - }) - - function UnSubscribeCallback() { - console.debug(TAG + "====>UnSubscribeCallback====>"); + let TAG = 'ACTS_startAbility_2200'; + await globalThis.abilityContext.startAbility( + { + bundleName: 'com.acts.error', + abilityName: 'com.acts.error.MainAbility2' + }, { + windowMode:0 + }).then(()=>{ + console.debug(TAG + "====>startAbility end====>"); + }).catch((err) => { + console.info(TAG + 'ACTS_startAbility_2200 - error'); + expect(err.code == 16000001).assertTrue(); done(); - } - - function timeout() { - console.debug(TAG + 'ACTS_startAbility_2200 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); + }) }) /* @@ -238,45 +219,23 @@ export default function abilityTest() { * @tc.desc : Start an ability with the parameter startability with options failed.(callback) */ it('ACTS_startAbility_2600', 0, async function (done) { - let TAG = 'ACTS_startAbility_2600' - let Subscriber - function SubscribeCallBack (err, data) { - expect().assertFail(); - console.debug(TAG + "====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug(TAG + "====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - console.debug(TAG + "====>start startAbility====>"); + let TAG = 'ACTS_startAbility_2600'; + console.debug(TAG + "====>start startAbility====>"); + try { await globalThis.abilityContext.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility2' - }, { + { + bundleName: 'com.acts.error', + abilityName: 'com.acts.error.MainAbility2' + }, { windowMode:0 - },() => { - console.debug(TAG + "====>startAbility end====>" ); + },(err) => { + console.info(TAG + "====>startAbility end====>" ); + expect(err.code == 16000001).assertTrue(); + done(); }) - }) - - function UnSubscribeCallback() { - console.debug(TAG + "====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug(TAG + 'ACTS_startAbility_2600 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } catch (err) { + console.info(TAG + 'ACTS_startAbility_2600 - error'); } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) /* @@ -427,24 +386,19 @@ export default function abilityTest() { * @tc.desc : Starting mainability3 with startAbilityForResult failed.(promise) */ it('ACTS_StartAbilityForResult_0200', 0, async function (done) { - let TAG = 'ACTS_StartAbilityForResult_0200' - function timeout() { - console.debug(TAG + 'ACTS_startAbilityForResult_0200 - timeout'); - done(); - } - setTimeout(timeout, START_ABILITY_TIMEOUT); + let TAG = 'ACTS_StartAbilityForResult_0200'; console.debug(TAG + "====>start startAbilityForResult====>"); await globalThis.abilityContext.startAbilityForResult( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility3', - }, { + { + bundleName: 'com.acts.error', + abilityName: 'com.acts.error.MainAbility3', + }, { windowMode:0 - }).then((data)=>{ + }).then((err, data)=>{ console.debug(TAG + "====>startAbilityForResult end====>"); - expect().assertFail(); - expect(data.resultCode).assertEqual(1) - expect(data.want.action).assertEqual('ACTION') + }).catch((err) => { + console.info(TAG + 'ACTS_startAbilityForResult_0200 - error'); + expect(err.code == 16000001).assertTrue(); done(); }) }) @@ -487,26 +441,23 @@ export default function abilityTest() { * @tc.desc : Starting mainability3 with startAbilityForResult failed.(callback) */ it('ACTS_StartAbilityForResult_0400', 0, async function (done) { - let TAG = 'ACTS_StartAbilityForResult_0400' - function timeout() { - console.debug(TAG + 'ACTS_startAbilityForResult_0400 - timeout'); - done(); - } - setTimeout(timeout, START_ABILITY_TIMEOUT); + let TAG = 'ACTS_StartAbilityForResult_0400'; console.debug(TAG + "====>start startAbilityForResult====>"); - await globalThis.abilityContext.startAbilityForResult( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility3', - }, { - windowMode:0 - },(err,data)=>{ - expect().assertFail(); - console.debug(TAG + "====>startAbilityForResult end====>"); - expect(data.resultCode).assertEqual(1) - expect(data.want.action).assertEqual('ACTION') - done(); - }) + try { + await globalThis.abilityContext.startAbilityForResult( + { + bundleName: 'com.acts.error', + abilityName: 'com.acts.error.MainAbility3', + }, { + windowMode:0 + },(err, data)=>{ + console.debug(TAG + "====>startAbilityForResult end====>"); + expect(err.code == 16000001).assertTrue(); + done(); + }) + } catch (err) { + console.info(TAG + 'ACTS_startAbilityForResult_0400 - error'); + } }) /* @@ -721,6 +672,7 @@ export default function abilityTest() { * then terminateself ability and return result succeeded.(callback) */ it('ACTS_TerminateSelfWithResult_0300', 0, async function (done) { + await sleep(2000); let TAG = 'ACTS_TerminateSelfWithResult_0300' var flag = true function timeout() { diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersThirdTest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsusers/ActsAmsUsersThirdTest/entry/src/main/ets/test/Ability.test.ets index 455e13eb3fd39a2d6941805ab4cac07a5d0c28b7..29f4efe147a80a107a40ab4e8d464113b77a27fa 100644 --- a/ability/ability_runtime/actsusers/ActsAmsUsersThirdTest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actsusers/ActsAmsUsersThirdTest/entry/src/main/ets/test/Ability.test.ets @@ -24,6 +24,11 @@ const START_ABILITY_TIMEOUT = 6000; console.debug("====>in Ability.test====>"); export default function abilityTest() { console.debug("====>in function abilityTest====>"); + + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + describe('ActsInterfaceMultiUsersThirdTest', function () { /* @@ -87,43 +92,19 @@ export default function abilityTest() { * @tc.desc : Start an ability with the parameter startability with options failed.(promise) */ it('ACTS_ThirdPartyStartAbility_0200', 0, async function (done) { - let Subscriber - function SubscribeCallBack (err, data) { - expect().assertFail(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(subscriberInfo_MainAbility).then((data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>start startAbility====>"); - await globalThis.abilityContext.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility2' - }, { - windowMode:0 - }).then(()=>{ - console.debug("====>startAbility end====>"); - }) - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); + await globalThis.abilityContext.startAbility( + { + bundleName: 'com.acts.error', + abilityName: 'com.acts.error.MainAbility2' + }, { + windowMode:0 + }).then((data)=>{ + console.debug("====>startAbility end====>"); + }).catch((err) => { + console.info('ACTS_ThirdPartyStartAbility_0200 - error ' + JSON.stringify(err)); + expect(err.code == 16000001).assertTrue(); done(); - } - - function timeout() { - console.debug('ACTS_ThirdPartyStartAbility_0200 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); + }) }) /* @@ -189,44 +170,21 @@ export default function abilityTest() { * @tc.desc : Start an ability with the parameter startability with options failed.(callback) */ it('ACTS_ThirdPartyStartAbility_0400', 0, async function (done) { - let Subscriber - function SubscribeCallBack (err, data) { - expect().assertFail(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - console.debug("====>start startAbility====>"); + try { await globalThis.abilityContext.startAbility( { bundleName: 'com.acts.error', abilityName: 'com.acts.error.MainAbility2' }, { - windowMode:0 - },() => { - console.debug("====>startAbility end====>" ); + windowMode:0 + },(err) => { + console.info("====>startAbility end====>" ); + expect(err.code == 16000001).assertTrue(); + done(); }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); + } catch (err) { + console.info('ACTS_ThirdPartyStartAbility_0400 - error'); } - - function timeout() { - console.debug('ACTS_ThirdPartyStartAbility_0400 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) /* @@ -288,41 +246,17 @@ export default function abilityTest() { * @tc.desc : Starting mainability2 with startability failed.(promise) */ it('ACTS_ThirdPartyStartAbility_0600', 0, async function (done) { - let Subscriber - function SubscribeCallBack (err, data) { - expect().assertFail(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(subscriberInfo_MainAbility).then((data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>start startAbility====>"); - await globalThis.abilityContext.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility2' - }).then(()=>{ - console.debug("====>startAbility end====>"); - }) - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); + await globalThis.abilityContext.startAbility( + { + bundleName: 'com.acts.error', + abilityName: 'com.acts.error.MainAbility2' + }).then(()=>{ + console.debug("====>startAbility end====>"); + }).catch ((err) => { + console.info('ACTS_ThirdPartyStartAbility_0600 - error'); + expect(err.code == 16000001).assertTrue(); done(); - } - - function timeout() { - console.debug('ACTS_ThirdPartyStartAbility_0600 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); + }) }) /* @@ -386,42 +320,19 @@ export default function abilityTest() { * @tc.desc : Starting mainability2 with startability failed.(callback) */ it('ACTS_ThirdPartyStartAbility_0800', 0, async function (done) { - let Subscriber - function SubscribeCallBack (err, data) { - expect().assertFail(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - console.debug("====>start startAbility====>"); + try { await globalThis.abilityContext.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility2' - },() => { + { + bundleName: 'com.acts.error', + abilityName: 'com.acts.error.MainAbility2' + },(err) => { console.debug("====>startAbility end====>" ); + expect(err.code == 16000001).assertTrue(); + done(); }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { + } catch (err) { console.debug('ACTS_ThirdPartyStartAbility_0800 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) /* @@ -462,11 +373,6 @@ export default function abilityTest() { * @tc.desc : Starting mainability3 with startAbilityForResult failed.(promise) */ it('ACTS_ThirdPartyStartAbilityForResult_0200', 0, async function (done) { - function timeout() { - console.debug('ACTS_ThirdPartyStartAbilityForResult_0200 - timeout'); - done(); - } - setTimeout(timeout, START_ABILITY_TIMEOUT); console.debug("====>start startAbilityForResult====>"); await globalThis.abilityContext.startAbilityForResult( { @@ -476,9 +382,9 @@ export default function abilityTest() { windowMode:0 }).then((data)=>{ console.debug("====>startAbilityForResult end====>"); - expect().assertFail(); - expect(data.resultCode).assertEqual(1) - expect(data.want.action).assertEqual('ACTION') + }).catch((err) => { + console.info('ACTS_ThirdPartyStartAbilityForResult_0200 - error'); + expect(err.code == 16000001).assertTrue(); done(); }) }) @@ -489,6 +395,7 @@ export default function abilityTest() { * @tc.desc : Starting mainability3 with startAbilityForResult succeeded.(callback) */ it('ACTS_ThirdPartyStartAbilityForResult_0300', 0, async function (done) { + await sleep(2000) var flag = true function timeout() { if(flag == true) { @@ -520,25 +427,22 @@ export default function abilityTest() { * @tc.desc : Starting mainability3 with startAbilityForResult failed.(callback) */ it('ACTS_ThirdPartyStartAbilityForResult_0400', 0, async function (done) { - function timeout() { - console.debug('ACTS_ThirdPartyStartAbilityForResult_0400 - timeout'); - done(); - } - setTimeout(timeout, START_ABILITY_TIMEOUT); console.debug("====>start startAbilityForResult====>"); - await globalThis.abilityContext.startAbilityForResult( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility3', - }, { - windowMode:0 - },(err,data)=>{ - expect().assertFail(); - console.debug("====>startAbilityForResult end====>"); - expect(data.resultCode).assertEqual(1) - expect(data.want.action).assertEqual('ACTION') - done(); - }) + try { + await globalThis.abilityContext.startAbilityForResult( + { + bundleName: 'com.acts.error', + abilityName: 'com.acts.error.MainAbility3', + }, { + windowMode:0 + },(err,data)=>{ + console.info("====>startAbilityForResult end====>"); + expect(err.code == 16000001).assertTrue(); + done(); + }) + } catch (err) { + console.debug('ACTS_ThirdPartyStartAbilityForResult_0400 - error'); + } }) /* @@ -547,6 +451,7 @@ export default function abilityTest() { * @tc.desc : Starting mainability3 with startAbilityForResult succeeded.(promise) */ it('ACTS_ThirdPartyStartAbilityForResult_0500', 0, async function (done) { + await sleep(2000) var flag = true function timeout() { if(flag == true) { @@ -577,23 +482,18 @@ export default function abilityTest() { * @tc.desc : Starting mainability3 with startAbilityForResult failed.(promise) */ it('ACTS_ThirdPartyStartAbilityForResult_0600', 0, async function (done) { - function timeout() { - console.debug('ACTS_ThirdPartyStartAbilityForResult_0600 - timeout'); - done(); - } - setTimeout(timeout, START_ABILITY_TIMEOUT); console.debug("====>start startAbilityForResult====>"); await globalThis.abilityContext.startAbilityForResult( { bundleName: 'com.acts.error', abilityName: 'com.acts.error.MainAbility3', }).then((data)=>{ - console.debug("====>startAbilityForResult end====>"); - expect().assertFail(); - expect(data.resultCode).assertEqual(1) - expect(data.want.action).assertEqual('ACTION') - done(); - }) + console.debug("====>startAbilityForResult end====>"); + }).catch((err) => { + console.info('ACTS_ThirdPartyStartAbilityForResult_0600 - error'); + expect(err.code == 16000001).assertTrue(); + done(); + }) }) /* @@ -602,6 +502,7 @@ export default function abilityTest() { * @tc.desc : Starting mainability3 with startAbilityForResult succeeded.(callback) */ it('ACTS_ThirdPartyStartAbilityForResult_0700', 0, async function (done) { + await sleep(2000) var flag = true function timeout() { if(flag == true) { @@ -631,23 +532,20 @@ export default function abilityTest() { * @tc.desc : Starting mainability3 with startAbilityForResult failed.(callback) */ it('ACTS_ThirdPartyStartAbilityForResult_0800', 0, async function (done) { - function timeout() { - console.debug('ACTS_ThirdPartyStartAbilityForResult_0800 - timeout'); - done(); - } - setTimeout(timeout, START_ABILITY_TIMEOUT); console.debug("====>start startAbilityForResult====>"); - await globalThis.abilityContext.startAbilityForResult( + try { + await globalThis.abilityContext.startAbilityForResult( { bundleName: 'com.acts.error', abilityName: 'com.acts.error.MainAbility3', },(err,data)=>{ - expect().assertFail(); - console.debug("====>startAbilityForResult end====>"); - expect(data.resultCode).assertEqual(1) - expect(data.want.action).assertEqual('ACTION') - done(); - }) + console.info("====>startAbilityForResult end====>"); + expect(err.code == 16000001).assertTrue(); + done(); + }) + } catch (err) { + console.debug('ACTS_ThirdPartyStartAbilityForResult_0800 - error'); + } }) /* @@ -704,50 +602,6 @@ export default function abilityTest() { }) - /* - * @tc.number : ACTS_TerminateSelf_0200 - * @tc.name : Use terminateself to terminate ability - * @tc.desc : Starting mainability2 with startAbility then terminateself ability failed.(promise) - */ - it('ACTS_TerminateSelf_0200', 0, async function (done) { - let Subscriber - function SubscribeCallBack (err, data) { - expect().assertFail(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async(SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>start startAbility====>"); - await globalThis.abilityContext.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility2' - }).then(()=>{ - console.debug("====>startAbility end====>"); - }) - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_TerminateSelf_0200 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - /* * @tc.number : ACTS_TerminateSelf_0300 * @tc.name : Use terminateself to terminate ability @@ -803,50 +657,6 @@ export default function abilityTest() { }) - /* - * @tc.number : ACTS_TerminateSelf_0400 - * @tc.name : Use terminateself to terminate ability - * @tc.desc : Starting mainability2 with startAbility then terminateself ability failed.(callback) - */ - it('ACTS_TerminateSelf_0400', 0, async function (done) { - let Subscriber - function SubscribeCallBack (err, data) { - expect().assertFail(); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async(SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>start startAbility====>"); - await globalThis.abilityContext.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility2' - },() => { - console.debug("====>startAbility end====>" ); - }) - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_TerminateSelf_0400 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - /* * @tc.number : ACTS_TerminateSelfWithResult_0100 * @tc.name : Use terminateselfwithresult to terminate ability and return result @@ -854,6 +664,7 @@ export default function abilityTest() { * then terminateself ability and return result succeeded.(promise) */ it('ACTS_TerminateSelfWithResult_0100', 0, async function (done) { + await sleep(2000) var flag = true function timeout() { if(flag == true) { @@ -878,32 +689,6 @@ export default function abilityTest() { }) }) - /* - * @tc.number : ACTS_TerminateSelfWithResult_0200 - * @tc.name : Use terminateselfwithresult to terminate ability and return result - * @tc.desc : Starting mainability3 with startAbilityforresult - * then terminateself ability and return result failed.(promise) - */ - it('ACTS_TerminateSelfWithResult_0200', 0, async function (done) { - function timeout() { - console.debug('ACTS_TerminateSelfWithResult_0200 - timeout'); - done(); - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await globalThis.abilityContext.startAbilityForResult( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility3', - }).then((data)=>{ - console.debug("====>startAbilityForResult end====>"); - expect().assertFail(); - expect(data.resultCode).assertEqual(1) - expect(data.want.action).assertEqual('ACTION') - done(); - }) - }) - /* * @tc.number : ACTS_TerminateSelfWithResult_0300 * @tc.name : Use terminateselfwithresult to terminate ability and return result @@ -911,6 +696,7 @@ export default function abilityTest() { * then terminateself ability and return result succeeded.(callback) */ it('ACTS_TerminateSelfWithResult_0300', 0, async function (done) { + await sleep(2000) var flag = true function timeout() { if (flag == true) { @@ -933,31 +719,5 @@ export default function abilityTest() { done(); }) }) - - /* - * @tc.number : ACTS_TerminateSelfWithResult_0400 - * @tc.name : Use terminateselfwithresult to terminate ability and return result - * @tc.desc : Starting mainability3 with startAbilityforresult - * then terminateself ability and return result failed.(callback) - */ - it('ACTS_TerminateSelfWithResult_0400', 0, async function (done) { - function timeout() { - console.debug('ACTS_TerminateSelfWithResult_0400 - timeout'); - done(); - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await globalThis.abilityContext.startAbilityForResult( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility3', - },(err,data)=>{ - expect().assertFail(); - console.debug("====>startAbilityForResult end====>"); - expect(data.resultCode).assertEqual(1) - expect(data.want.action).assertEqual('ACTION') - done(); - }) - }) }) } \ No newline at end of file diff --git a/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility/MainAbility.ts index e7b2eeb8fed9163f149f712f9c74e1aa1903c8bf..733c7477e3e56c1858a08a5346b33dd088ab2a5f 100644 --- a/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -36,7 +36,20 @@ export default class TestAbility extends Ability { onWindowStageCreate(windowStage) { console.log('TestAbility onWindowStageCreate') + globalThis.onWindowStageActive = false; + let count = 0; windowStage.setUIContent(this.context, 'MainAbility/pages/index', null) + windowStage.on('windowStageEvent', (data) => { + console.log(`ActsApiTest onWindwoStage is : ${JSON.stringify(data)}`) + if (data == 2 ) { + console.log(`ActsApiTest onWindwoStage count is : ${count}`) + count++; + if (count == 2) { + console.log(`ActsApiTest onWindwoStage count is : ${count}`) + globalThis.onWindowStageActive = true; + } + } + }) } onWindowStageDestroy() { diff --git a/ability/ability_runtime/apitest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/apitest/entry/src/main/ets/test/Ability.test.ets index 7784ab65062026af5f68b2ea4dd9c84516d5e0cd..f1a78a73901535a8f71d3704a4986bf29a309193 100644 --- a/ability/ability_runtime/apitest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/apitest/entry/src/main/ets/test/Ability.test.ets @@ -31,7 +31,18 @@ export default function abilityTest() { describe('ActsChangeAbilityStagetest', function () { beforeAll(async function (done) { console.info('beforeAll called') - await sleep(2000) + let delay = 3000; + let start = new Date().getTime(); + while (true) { + if (globalThis.onWindowStageActive) { + console.log(`ActsApiTest getWindwoStageActive is success`) + break; + } + if (new Date().getTime() - start > delay) { + console.log(`ActsApiTest getWindwoStageActive is failed`) + break; + } + } await globalThis.abilitydelegator.getCurrentTopAbility().then((data) => { mainability = data done() diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/test/FmsAcquireForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/test/FmsAcquireForm.test.ets index e20ede1bbea2a817efd2e358689a13a052631948..335bc33a0113f802026e68b68d0348de8c61f8e2 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/test/FmsAcquireForm.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/test/FmsAcquireForm.test.ets @@ -82,7 +82,7 @@ export default function test() { function onErrorCallBack(_, data) { console.info("!!!====>FMS_acquireForm_0200 onErrorCallBack data:====>" + JSON.stringify(data)); expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - expect(data.data).assertEqual("check permission deny, need to request ohos.permission.REQUIRE_FORM."); + expect(data.data).assertEqual("check permission deny, need to request ohos.permission.REQUIRE_FORM or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS."); commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_0200")); console.info(`FMS_acquireForm_0200 end`); done(); diff --git a/ability/ability_runtime/non_concurrent/BUILD.gn b/ability/ability_runtime/non_concurrent/BUILD.gn index e734985f082014b5bcf6cbde442fd583aa5139ee..baccf60e023a77fc58dc59f1313154c0acd110f9 100644 --- a/ability/ability_runtime/non_concurrent/BUILD.gn +++ b/ability/ability_runtime/non_concurrent/BUILD.gn @@ -19,8 +19,6 @@ group("non_concurrent") { deps = [ "acts_systemappa_test:ActsSystemAppATest", "acts_systemappone_rely_test:ActsSystemAppOneRelyHap", - "actsthirdappatest:ActsThirdAppATest", - "actsthirdapponerelytest:ActsThirdAppOneRelyHap", ] } } diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/Test.json b/ability/ability_runtime/non_concurrent/actsthirdappatest/Test.json deleted file mode 100755 index e8f26a5ec2c0e6f99be45520754c02eb0a64c109..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/Test.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "description": "Configuration for aceceshi Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "300000", - "bundle-name": "com.example.actsabilitypermissionthirdtest", - "module-name": "entry", - "shell-timeout": "300000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "power-shell setmode 602" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "remount" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "acm create -n 101 -t normal", - "acm switch -i 101" - ], - "teardown-command": [ - "acm delete -i 101" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "acm switch -i 100" - ] - }, - { - "type": "PushKit", - "push": [ - "ActsThirdAppATest.hap->/data/app/ActsThirdAppATest.hap", - "ActsThirdAppOneRelyHap.hap->/data/app/ActsThirdAppOneRelyHap.hap" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "bm install -u100 -p /data/app/ActsThirdAppATest.hap", - "bm install -u101 -p /data/app/ActsThirdAppOneRelyHap.hap" - ], - "teardown-command": [ - "bm uninstall -n com.example.actsabilitypermissionthirdtest" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 644 /data/*.hap" - ] - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 518c7f953cd22b92ad31e3f8772a65d8d95b9de4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100755 index 570d85445cb110a1817470d768a3c1a06768bee4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.app.ability.UIAbility' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne1() { - console.debug("====>Publish CallBack ACTS_ThirdPartyAbilityPermission_0100_CommonEvent====>"); - globalThis.ability2Context.terminateSelf(); - console.debug("====>close this context====>") -} - - -export default class MainAbility2 extends Ability { - - onCreate(want, launchParam) { - console.log("MainAbility2 onCreate") - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility2 onWindowStageCreate") - windowStage.setUIContent(this.context, "pages/index/index2", null) - globalThis.ability2Context = this.context; - commonEvent.publish("ACTS_ThirdPartyAbilityPermission_0100_Start_CommonEvent", PublishCallBackOne1); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility2 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility2 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("MainAbility2 onBackground") - } -}; diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/TestAbility/TestAbility.ts b/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100755 index d466fc86120520db850d208180f76c5303169f65..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Ability from '@ohos.app.ability.UIAbility' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - console.log('TestAbility onCreate') - globalThis.abilityContext = this.context; - } - - onDestroy() { - console.log('TestAbility onDestroy') - } - - onWindowStageCreate(windowStage) { - console.log('TestAbility onWindowStageCreate') - windowStage.setUIContent(this.context, 'TestAbility/pages/index', null) - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - onWindowStageDestroy() { - console.log('TestAbility onWindowStageDestroy') - } - - onForeground() { - console.log('TestAbility onForeground') - } - - onBackground() { - console.log('TestAbility onBackground') - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/test/AbilityPermission.test.ets b/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/test/AbilityPermission.test.ets deleted file mode 100755 index b76f99e9319e13eb863f324b3f4dd1819aa59c18..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/test/AbilityPermission.test.ets +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' -import commonEvent from '@ohos.commonEvent' -var AbilityPermission1 = { - events: ["ACTS_ThirdPartyAbilityPermission_0100_Start_CommonEvent"] -} -var AbilityPermission3 = { - events: ["ACTS_ThirdPartyAbilityPermission_0300_Start_CommonEvent"] -} -var AbilityPermission6 = { - events: ["ACTS_ThirdPartyAbilityPermission_0600_Start_CommonEvent"] -} -const START_ABILITY_TIMEOUT = 3000; - -export default function abilityPermissionTest() { - describe('ActsAbilityPermissionTest', function () { - var userA=100; - var userB=101; - /* - * @tc.number: ACTS_ThirdPartyAbilityPermission_0100 - * @tc.name: In non-concurrent mode, if the target application is not the current user, it is forbidden to start - * @tc.desc: Start an ability that belongs to the current user with the current user - */ - it('ACTS_ThirdPartyAbilityPermission_0100', 0, async function (done) { - console.log("ACTS_ThirdPartyAbilityPermission_0100====>callback start====>") - var Subscriber; - var flag = true; - - function SubscribeCallBack(err, data) { - console.debug("ACTS_ThirdPartyAbilityPermission_0100====>Subscribe CallBack data:" + JSON.stringify(data)); - expect(data.event == 'ACTS_ThirdPartyAbilityPermission_0100_Start_CommonEvent').assertTrue() - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(AbilityPermission1).then(async (data) => { - console.debug("ACTS_ThirdPartyAbilityPermission_0100====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>start startAbility_100====>"); - await globalThis.abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsabilitypermissionthirdtest', - abilityName: 'MainAbility2' - }, userA, () => { - console.debug("====>startAbility end_100====>"); - }) - }) - - function UnSubscribeCallback() { - flag = false - console.debug("ACTS_ThirdPartyAbilityPermission_0100====>UnSubscribe CallBack====>"+flag); - done(); - } - setTimeout(()=>{ - if (flag == true) { - expect().assertFail(); - console.debug('in ACTS_ThirdPartyAbilityPermission_0100====>timeout====>'+flag); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - console.debug('ACTS_ThirdPartyAbilityPermission_0100====>timeout====>'); - }, START_ABILITY_TIMEOUT); - }) - /* - * @tc.number: ACTS_ThirdPartyAbilityPermission_0300 - * @tc.name: In non-concurrent mode, if the target application is not the current user, it is forbidden to start - * @tc.desc: Start an ability under user U101 with the current user - */ - it('ACTS_ThirdPartyAbilityPermission_0300', 0, async function (done) { - console.log("ACTS_ThirdPartyAbilityPermission_0300====>callback start====>") - var Subscriber - var flag = 0; - console.debug("====>get AccountManager finish===="); - - function SubscribeCallBack(err, data) { - console.debug("ACTS_ThirdPartyAbilityPermission_0300====>Subscribe CallBack data:" + JSON.stringify(data)); - expect(data.event == 'ACTS_ThirdPartyAbilityPermission_0300_Start_CommonEvent').assertTrue() - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - commonEvent.createSubscriber(AbilityPermission3).then(async (data) => { - console.debug("ACTS_ThirdPartyAbilityPermission_0300====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>start startAbility_0300====>"); - await globalThis.abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsthirdappuonehundredone', - abilityName: 'MainAbility' - }, userB ).then().catch((err) => { - console.debug("ACTS_ThirdPartyAbilityPermission_0300====>" + err) - console.debug("====>startAbility end_0300====>"); - }) - }) - function UnSubscribeCallback() { - if(flag == 0) { - expect().assertFail(); - } - console.debug("ACTS_ThirdPartyAbilityPermission_0300====>UnSubscribe CallBack====>"); - done(); - } - function timeout() { - console.debug('ACTS_ThirdPartyAbilityPermission_0300====>timeout====>'); - if(flag == 0){ - flag = 1; - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number: ACTS_ThirdPartyAbilityPermission_0600 - * @tc.name: In non-concurrent mode, if the target application is not the current user, it is forbidden to start - * @tc.desc: Bind a U101 Ability with the current user - */ - it('ACTS_ThirdPartyAbilityPermission_0600', 0, async function (done) { - console.log("ACTS_ThirdPartyAbilityPermission_0600====>callback start====>") - let Subscriber - let connId - function onConnectCallbackC(element, remote) { - console.log('ACTS_ThirdPartyAbilityPermission_0600_Start_CommonEvent onConnectCallback====>'+ - ' element=' + JSON.stringify(element)); - console.log('ACTS_ThirdPartyAbilityPermission_0600_Start_CommonEvent onConnectCallback====>'+ - ' remote=' + JSON.stringify(remote)); - expect().assertFail(); - } - function onDisconnectCallbackC(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - function onFailedCallbackC(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - function SubscribeCallBackF(err, data) { - console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); - } - function UnSubscribeCallbackF() { - console.debug("====>UnSubscribeCallback====>"); - } - commonEvent.createSubscriber(AbilityPermission6).then(async (data) => { - console.debug("====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBackF); - }) - console.debug("====>0600start connectAbility====>"); - connId = await globalThis.abilityContext.connectAbilityWithAccount( - { - bundleName: 'com.example.actsthirdappuonehundredone', - abilityName: 'ServiceAbility', - action: "StartAbilityPromise" - }, userB, { - onConnect: onConnectCallbackC, - onDisconnect: onDisconnectCallbackC, - onFailed: onFailedCallbackC - }) - console.debug("====>number is====>" + JSON.stringify(connId)); - setTimeout(() =>{ - console.debug('in ACTS_ThirdPartyAbilityPermission_0600_Start_CommonEvent timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallbackF) - done() - }, START_ABILITY_TIMEOUT); - }) - }) -} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/module.json b/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/module.json deleted file mode 100755 index cc21d8f40e4da254d8052325cfd87bc4ac42343c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/module.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:entry_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "metadata": [ - { - "name": "ArkTSPartialUpdate", - "value": "false" - } - ], - "abilities": [ - { - "name": "TestAbility", - "srcEntrance": "./ets/TestAbility/TestAbility.ts", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "launchType": "standard", - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - }, - { - "name": "MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", - "description": "$string:MainAbility2_desc", - "icon": "$media:icon", - "label": "$string:MainAbility2_label", - "launchType": "standard" - } - ] - } -} diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 4316d006d2b44028ddfd4c08ca6ad6c2f4104655..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "string": [ - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "entry_test_desc", - "value": "i am an entry for tv" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - }, - { - "name": "MainAbility2_desc", - "value": "description" - }, - { - "name": "MainAbility2_label", - "value": "label" - }, - { - "name": "Service_desc", - "value": "description" - }, - { - "name": "Service_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 811dc7b52a811fa568820af95eea7762ae3ca5cc..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index2", - "TestAbility/pages/index" - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index a41751fb10f96d4103d1120e59c5c5f5aa089e72..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 1957f1056d8bc727d5613ee8930578fd09877f26..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.app.ability.UIAbility' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne3() { - console.debug("====>Publish CallBack ACTS_ThirdPartyAbilityPermission_0300_CommonEvent====>"); - setTimeout(globalThis.abilityContext.terminateSelfWithResult(()=>{ - console.debug("====>terminateSelfWithResult succese====>") - }),1000) -} - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - commonEvent.publish("ACTS_ThirdPartyAbilityPermission_0300_Start_CommonEvent", PublishCallBackOne3); - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; diff --git a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/module.json b/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/module.json deleted file mode 100755 index 1c418141ce162490c369aa4f6edb6f2d0f3a75ba..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/module.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "module": { - "name": "com.example.actsthirdappuonehundredone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "metadata": [ - { - "name": "ArkTSPartialUpdate", - "value": "false" - } - ], - "abilities": [ - { - "name": "MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/resources/base/element/string.json deleted file mode 100755 index d75325f3cf0a50c1dfe4dbc5162c8737276c3dd9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/applications/settingsdata/settings_ets/signature/openharmony_sx.p7b b/applications/settingsdata/settings_ets/signature/openharmony_sx.p7b index df06998b7afe63bc01cd95a9ab616b5a3a7e78c8..f504d61253b3327e39185225c07fbcc7e974fb51 100644 Binary files a/applications/settingsdata/settings_ets/signature/openharmony_sx.p7b and b/applications/settingsdata/settings_ets/signature/openharmony_sx.p7b differ diff --git a/arkXtest/uitest/BUILD.gn b/arkXtest/uitest/BUILD.gn index a60ae13c984e01c842063c3e30a285cc9cc68416..0a3f1dea51e82b932112cf25b3a7876e066f85de 100644 --- a/arkXtest/uitest/BUILD.gn +++ b/arkXtest/uitest/BUILD.gn @@ -22,6 +22,8 @@ ohos_js_hap_suite("ActsUiTest") { ets2abc = true certificate_profile = "//test/xts/acts/arkXtest/uitest/signature/auto_ohos_default_com.uitest.test.p7b" hap_name = "ActsUiTest" + part_name = "arkXtest" + subsystem_name = "arkXtest" } ohos_js_assets("uitest_ets_assets") { diff --git a/arkXtest/uitest/src/main/ets/test/uitest.test.ets b/arkXtest/uitest/src/main/ets/test/uitest.test.ets index 07bde45a66b772b8445e0faf394df72fd57ee332..8ed5eeb449c8de3fa9e81f4e73ad64091ad83d19 100644 --- a/arkXtest/uitest/src/main/ets/test/uitest.test.ets +++ b/arkXtest/uitest/src/main/ets/test/uitest.test.ets @@ -166,6 +166,20 @@ export default function UiTest() { expect(button2 != null).assertTrue() await stopApplication('com.uitestScene.acts') }) + + /* + * @tc.number: uiTest_10007 + * @tc.name: testInWindow + * @tc.desc: scroll the mouse wheel at the specified location to specify the cell. + */ + it('testInWindow', 0, async function () { + await startAbility('com.uitestScene.acts', 'com.uitestScene.acts.MainAbility') + let driver = Driver.create() + await driver.delayMs(waitUiReadyMs) + let btn = await driver.findComponent(ON.inWindow('com.uitestScene.acts').text('next page')) + expect(btn != null).assertTrue() + await stopApplication('com.uitestScene.acts') + }) }) describe('UiTest_API8', function () { diff --git a/arkXtest/uitestScene/BUILD.gn b/arkXtest/uitestScene/BUILD.gn index 246b67fcff359a14d156925601fa5be65f67c518..82fb621e186d0d04baab352e6c1f40b5feae2a87 100644 --- a/arkXtest/uitestScene/BUILD.gn +++ b/arkXtest/uitestScene/BUILD.gn @@ -24,6 +24,8 @@ ohos_hap_assist_suite("ActsUiTestScene") { testonly = true certificate_profile = "//test/xts/acts/arkXtest/uitestScene/signature/auto_ohos_default_com.uitestScene.test.p7b" hap_name = "ActsUiTestScene" + part_name = "arkXtest" + subsystem_name = "arkXtest" } ohos_js_assets("uitest_scene_ets_assets") { diff --git a/arkui/ace_ets_components_ux/BUILD.gn b/arkui/ace_ets_components_ux/BUILD.gn index 569f288e4bcf0d31d25d638bcdff227447596f9a..ab5847a07cfd14bf8160404cd6af9deeb1c18ffc 100644 --- a/arkui/ace_ets_components_ux/BUILD.gn +++ b/arkui/ace_ets_components_ux/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -15,9 +15,21 @@ group("componentUxTest") { testonly = true if (is_standard_system) { deps = [ + "ace_ets_component_badge:ActsAcebadgeTest", + "ace_ets_component_button:ActsAceButtonTest", + "ace_ets_component_checkbox:ActsAceCheckboxTest", + "ace_ets_component_datapanel:ActsAceDatapanelTest", + "ace_ets_component_datepicker:ActsAceDatePickerTest", + "ace_ets_component_progress:ActsAceProgressTest", + "ace_ets_component_radio:ActsAceRadioTest", "ace_ets_component_select:ActsAceSelectTest", "ace_ets_component_sidebar:ActsAceSideBarTest", + "ace_ets_component_swiper:ActsAceSwiperTest", "ace_ets_component_tabs:ActsAceTabsTest", + "ace_ets_component_text:ActsAceTextTest", + "ace_ets_component_textinput:ActsAceTextInputTest", + "ace_ets_component_textpicker:ActsAceTextPickerTest", + "ace_ets_component_timepicker:ActsAceTimePickerTest", ] } } diff --git a/arkui/ace_ets_components_ux/ace_ets_component_badge/AppScope/app.json b/arkui/ace_ets_components_ux/ace_ets_component_badge/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..b2fdb386b6bce5a023a38b2cfc49d9ab90e11936 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_badge/AppScope/app.json @@ -0,0 +1,19 @@ +{ + "app": { + "bundleName": "com.example.badgetest", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_badge/AppScope/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_badge/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..30af7cfee6766dda361b893d1565490dc145fdf0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_badge/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"MyApplication" + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_components_ux/ace_ets_component_badge/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from ability/ability_runtime/non_concurrent/actsthirdappatest/AppScope/resources/base/media/app_icon.png rename to arkui/ace_ets_components_ux/ace_ets_component_badge/AppScope/resources/base/media/app_icon.png diff --git a/arkui/ace_ets_components_ux/ace_ets_component_badge/BUILD.gn b/arkui/ace_ets_components_ux/ace_ets_component_badge/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..e1532d9980a0e95ca764c2793cf0b8faba0d7ac7 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_badge/BUILD.gn @@ -0,0 +1,43 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAcebadgeTest") { + hap_profile = "src/main/module.json" + js_build_mode = "debug" + deps = [ + ":ace_ets_component_badge_js_assets", + ":ace_ets_component_badge_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsAcebadgeTest" + part_name = "ace_engine" + subsystem_name = "arkui" +} + +ohos_app_scope("ace_ets_component_badge_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("ace_ets_component_badge_js_assets") { + source_dir = "src/main/ets" +} + +ohos_resources("ace_ets_component_badge_resources") { + sources = [ "src/main/resources" ] + deps = [ ":ace_ets_component_badge_profile" ] + hap_profile = "src/main/module.json" +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_badge/Test.json b/arkui/ace_ets_components_ux/ace_ets_component_badge/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..2712a2a2037818a6bd5a4416f0f56138f70e56c6 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_badge/Test.json @@ -0,0 +1,26 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "600000", + "bundle-name": "com.example.badgetest", + "module-name": "phone", + "shell-timeout": "600000", + "testcase-timeout": 240000 + }, + "kits": [{ + "test-file-name": [ + "ActsAcebadgeTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "power-shell wakeup", + "power-shell setmode 602" + ] + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/signature/openharmony_sx.p7b b/arkui/ace_ets_components_ux/ace_ets_component_badge/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 74% rename from ability/ability_runtime/non_concurrent/actsthirdappatest/signature/openharmony_sx.p7b rename to arkui/ace_ets_components_ux/ace_ets_component_badge/signature/openharmony_sx.p7b index a51eeb213f705970c4e887336a4535d0a8bee74d..ad6a4f20044e4c0432b47ace93223e1b5df37ad8 Binary files a/ability/ability_runtime/non_concurrent/actsthirdappatest/signature/openharmony_sx.p7b and b/arkui/ace_ets_components_ux/ace_ets_component_badge/signature/openharmony_sx.p7b differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/TestAbility/TestAbility.ets b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/TestAbility/TestAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d65dd2ea8346a8b5d12ac7aff026197a95abaea --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/TestAbility/TestAbility.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import Ability from '@ohos.app.ability.UIAbility' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import testsuite from '../test/List.test' +import Window from '@ohos.window' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('TestAbility/pages/Index', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/TestAbility/pages/Index.ets b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/TestAbility/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..45940cc054d01b85d3e296fada57a29058717c38 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/TestAbility/pages/Index.ets @@ -0,0 +1,718 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + //@ts-nocheck +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import hilog from '@ohos.hilog'; +import testsuite from '../../test/List.test' +@Entry +@Component +struct badgeTest { + + aboutToAppear(){ + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + build() { + Row() { + Column() { + List({space: 0, initialIndex: 0 }){ + ListItem(){ + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red ,fontWeight: 0} + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100).height(50) + .key("ArkUX_Stage_Badge_FontWeight_0100") + } + ListItem(){ + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, fontWeight: 400 } + }) { + Text("test") + .width(100).height(50) + } + .key("ArkUX_Stage_Badge_FontWeight_0200") + .width(100).height(50) + } + ListItem(){ + Badge({ + value: 'new', + style: { badgeSize: 6, badgeColor: '#FA2A2D', fontWeight: 100 } + }) { + Image($r("app.media.app_icon")) + .width(24) + .height(24) + } + .key("ArkUX_Stage_Badge_FontWeight_0300") + .width(100).height(50) + } + ListItem(){ + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, fontWeight: "800" } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_FontWeight_0400") + .width(100).height(50) + } + ListItem(){ + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, fontWeight: 200 } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_FontWeight_0500") + .width(100).height(50) + } + ListItem(){ + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, fontWeight: 900 } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_FontWeight_0600") + .width(100).height(50) + } + ListItem(){ + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, + fontWeight: FontWeight.Bolder} + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_FontWeight_0700") + .width(100).height(50) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, fontWeight: 1000 } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_FontWeight_0800") + .width(100).height(50) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, fontWeight: null } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_FontWeight_0900") + .width(100).height(50) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, fontWeight: undefined} + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_FontWeight_1000") + .width(100).height(50) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, fontWeight: -1 } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_FontWeight_1100") + .width(100).height(50) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, fontWeight: "" } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_FontWeight_1200") + .width(100).height(50) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, fontWeight: "adf@$5" } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_FontWeight_1300") + .width(100).height(50) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, + fontWeight: 200, fontWeight: 500 } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_FontWeight_1400") + .width(100).height(50) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, + fontWeight: 500, fontWeight: null } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_FontWeight_1500") + .width(100).height(50) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red ,fontWeight: 600 } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_FontWeight_1600") + .width(100).height(50) + .layoutWeight(null) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red ,borderColor: 0x00ff00 } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderColor_0100").height(20) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, + borderColor: '#fffd0000' } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderColor_0200").height(20) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, + borderColor: 'rgb(138,43,226)' } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderColor_0300").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, borderColor: Color.Pink } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderColor_0400").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, + borderColor: $r("app.color.badge_BorderColor") } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderColor_0500").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, borderColor: "" } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderColor_0600").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, borderColor: null } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderColor_0700").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, borderColor: undefined } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderColor_0800").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, + borderColor: "rgb(138,43,226)", borderColor: Color.Pink} + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderColor_0900").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, + borderColor: "rgb(138,43,226)", borderColor: undefined } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderColor_1000").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, + borderColor: 'bgr(138,43,226)' } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderColor_1100").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, + borderColor: 0x00ff00 } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderColor_1200") + .height(20) + .backgroundColor(null) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, borderWidth: 5 } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderWidth_0100").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, borderWidth: "5px" } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderWidth_0200").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, + borderWidth: $r("app.string.badge_Size_test") } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderWidth_0300").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, borderWidth: "" } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderWidth_0400").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, borderWidth: null } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderWidth_0500").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, borderWidth: undefined } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderWidth_0600").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, + borderWidth: 5, borderWidth: "7fp" } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderWidth_0700").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, + borderWidth: 5, borderWidth: undefined } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderWidth_0800").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, borderWidth: "asdf%^7" } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderWidth_0900").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red, borderWidth: "5lpx" } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderWidth_1000") + .height(20) + .width(7) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red , borderWidth: 0 } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderWidth_1100").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red , + borderWidth: 5 ,borderColor: "#FFFD0000", fontWeight: 600 } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderWidth_1200").height(20) + .margin({ + top: 10 + }) + } + ListItem() { + Badge({ + count: 1, + maxCount: 99, + position: BadgePosition.RightTop, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button("test") + .onClick((event: ClickEvent) => { + }) + .width(200).height(50).backgroundColor(0x317aff) + } + .key("ArkUX_Stage_Badge_BorderWidth_1300").height(20) + .margin({ + top: 10 + }) + } + } + } + .width('100%') + } + .height('100%') + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6c662824093f9339085214d247c6247faa86ae9 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s it', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${targetParams} ${key} ${parameters[key]}` + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/test/List.test.ets b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..65f94e485f3ceddb0df0127e0a57e22f77a282b0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import badgeTest from './badge' + +export default function testsuite() { + badgeTest() +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/test/badge.ets b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/test/badge.ets new file mode 100644 index 0000000000000000000000000000000000000000..2683a273de9a242324a1724dd33c8a22a41a3ca4 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/test/badge.ets @@ -0,0 +1,1191 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' + +function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve("ok") + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) +} +export default function badgeTest() { + describe('ActsBadgeTest', function () { + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_0100 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Badge component container for Bttton, set fontWeight property parameter to 0 + */ + it('ArkUX_Stage_Badge_FontWeight_0100', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_0100'); + console.info('ArkUX_Stage_Badge_FontWeight_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_0100 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_0100 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.Normal"); + console.info('ArkUX_Stage_Badge_FontWeight_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_0200 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Badge component container for the Text component, + * set the fontWeight property parameter to the default value 400 + */ + it('ArkUX_Stage_Badge_FontWeight_0200', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_0200'); + console.info('ArkUX_Stage_Badge_FontWeight_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_0200 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_0200 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.400"); + console.info('ArkUX_Stage_Badge_FontWeight_0200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_0300 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Set the fontWeight attribute parameter to a minimum boundary value of 100 + * for the Badge component in its container + */ + it('ArkUX_Stage_Badge_FontWeight_0300', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_0300'); + console.info('ArkUX_Stage_Badge_FontWeight_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_0300 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_0300 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.100"); + console.info('ArkUX_Stage_Badge_FontWeight_0300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_0300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_0400 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Set the fontWeight attribute parameter to a string of "800" greater than the default value. + */ + it('ArkUX_Stage_Badge_FontWeight_0400', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_0400'); + console.info('ArkUX_Stage_Badge_FontWeight_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_0400 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_0400 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.800"); + console.info('ArkUX_Stage_Badge_FontWeight_0400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_0400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_0500 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Set the fontWeight property parameter to less than the default value of 200 + */ + it('ArkUX_Stage_Badge_FontWeight_0500', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_0500'); + console.info('ArkUX_Stage_Badge_FontWeight_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_0500 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_0500 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.200"); + console.info('ArkUX_Stage_Badge_FontWeight_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_0600 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Set the fontWeight property parameter to a maximum boundary value of 900 + */ + it('ArkUX_Stage_Badge_FontWeight_0600', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_0600'); + console.info('ArkUX_Stage_Badge_FontWeight_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_0600 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_0600 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.900"); + console.info('ArkUX_Stage_Badge_FontWeight_0600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_0700 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Set the FontWeight attribute parameter to enum type "fontweight. Bolder". + */ + it('ArkUX_Stage_Badge_FontWeight_0700', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_0700'); + console.info('ArkUX_Stage_Badge_FontWeight_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_0700 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_0700 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.Bolder"); + console.info('ArkUX_Stage_Badge_FontWeight_0700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_0700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_0800 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Example Set the fontWeight attribute to outside the value range of 1000 + */ + it('ArkUX_Stage_Badge_FontWeight_0800', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_0800'); + console.info('ArkUX_Stage_Badge_FontWeight_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_0800 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_0800 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.Normal"); + console.info('ArkUX_Stage_Badge_FontWeight_0800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_0800 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_0900 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Set the fontWeight property parameter to the exception value null + */ + it('ArkUX_Stage_Badge_FontWeight_0900', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_0900'); + console.info('ArkUX_Stage_Badge_FontWeight_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_0900 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_0900 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.Normal"); + console.info('ArkUX_Stage_Badge_FontWeight_0900 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_0900 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_1000 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Set the fontWeight property parameter to the exception value undefined + */ + it('ArkUX_Stage_Badge_FontWeight_1000', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_1000'); + console.info('ArkUX_Stage_Badge_FontWeight_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_1000 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_1000 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.Normal"); + console.info('ArkUX_Stage_Badge_FontWeight_1000 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_1000 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_1100 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Set the fontWeight property parameter to the exception value -1 + */ + it('ArkUX_Stage_Badge_FontWeight_1100', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_1100'); + console.info('ArkUX_Stage_Badge_FontWeight_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_1100 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_1100 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.Normal"); + console.info('ArkUX_Stage_Badge_FontWeight_1100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_1100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_1200 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Set the fontWeight property parameter to the exception value "" + */ + it('ArkUX_Stage_Badge_FontWeight_1200', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_1200'); + console.info('ArkUX_Stage_Badge_FontWeight_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_1200 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_1200 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.Normal"); + console.info('ArkUX_Stage_Badge_FontWeight_1200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_1200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_1300 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Set the fontWeight property parameter to the exception value "adf@$5" + */ + it('ArkUX_Stage_Badge_FontWeight_1300', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_1300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_1300'); + console.info('ArkUX_Stage_Badge_FontWeight_1300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_1300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_1300 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_1300 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.Normal"); + console.info('ArkUX_Stage_Badge_FontWeight_1300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_1300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_1400 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Set the fontWeight property parameter to 200 and again to 500 + */ + it('ArkUX_Stage_Badge_FontWeight_1400', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_1400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_1400'); + console.info('ArkUX_Stage_Badge_FontWeight_1400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_1400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_1400 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_1400 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.500"); + console.info('ArkUX_Stage_Badge_FontWeight_1400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_1300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_1500 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Set the fontWeight property parameter to 500, and again to the outlier null + */ + it('ArkUX_Stage_Badge_FontWeight_1500', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_1500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_1500'); + console.info('ArkUX_Stage_Badge_FontWeight_1500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_1500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_1500 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_1500 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.Normal"); + console.info('ArkUX_Stage_Badge_FontWeight_1500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_1500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_FontWeight_1600 + * @tc.name Tests the FontWeight property of the badge component + * @tc.desc Set the fontWeight attribute parameter to 600 greater than the default value, + * and set the generic layoutWeight attribute value to null + */ + it('ArkUX_Stage_Badge_FontWeight_1600', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_1600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_FontWeight_1600'); + console.info('ArkUX_Stage_Badge_FontWeight_1600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_FontWeight_1600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_FontWeight_1600 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_FontWeight_1600 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.fontWeight).assertEqual("FontWeight.600"); + console.info('ArkUX_Stage_Badge_FontWeight_1600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_FontWeight_1600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderColor_0100 + * @tc.name Tests the BorderColor property of the badge component + * @tc.desc Sets the BorderColor property parameter to 0x00ff00 + */ + it('ArkUX_Stage_Badge_BorderColor_0100', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderColor_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderColor_0100'); + console.info('ArkUX_Stage_Badge_BorderColor_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderColor_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderColor_0100 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderColor_0100 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_Badge_BorderColor_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderColor_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderColor_0200 + * @tc.name Tests the BorderColor property of the badge component + * @tc.desc Sets the BorderColor property parameter to '#fffd0000' + */ + it('ArkUX_Stage_Badge_BorderColor_0200', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderColor_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderColor_0200'); + console.info('ArkUX_Stage_Badge_BorderColor_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderColor_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderColor_0200 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderColor_0200 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_Badge_BorderColor_0200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderColor_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderColor_0300 + * @tc.name Tests the BorderColor property of the badge component + * @tc.desc Sets the BorderColor property parameter to 'rgb(138,43,226)' + */ + it('ArkUX_Stage_Badge_BorderColor_0300', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderColor_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderColor_0300'); + console.info('ArkUX_Stage_Badge_BorderColor_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderColor_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderColor_0300 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderColor_0300 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderColor).assertEqual("#FF8A2BE2"); + console.info('ArkUX_Stage_Badge_BorderColor_0300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderColor_0300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderColor_0400 + * @tc.name Tests the BorderColor property of the badge component + * @tc.desc Sets the BorderColor property parameter to Color.Pink + */ + it('ArkUX_Stage_Badge_BorderColor_0400', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderColor_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderColor_0400'); + console.info('ArkUX_Stage_Badge_BorderColor_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderColor_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderColor_0400 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderColor_0400 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderColor).assertEqual("#FFFFC0CB"); + console.info('ArkUX_Stage_Badge_BorderColor_0400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderColor_0400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderColor_0500 + * @tc.name Tests the BorderColor property of the badge component + * @tc.desc Sets the BorderColor property parameter to $r("app.color.badge_BorderColor") + */ + it('ArkUX_Stage_Badge_BorderColor_0500', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderColor_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderColor_0500'); + console.info('ArkUX_Stage_Badge_BorderColor_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderColor_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderColor_0500 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderColor_0500 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_Badge_BorderColor_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderColor_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderColor_0600 + * @tc.name Tests the BorderColor property of the badge component + * @tc.desc Sets the BorderColor property parameter to the exception value "" + */ + it('ArkUX_Stage_Badge_BorderColor_0600', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderColor_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderColor_0600'); + console.info('ArkUX_Stage_Badge_BorderColor_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderColor_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderColor_0600 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderColor_0600 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderColor).assertEqual("#FFFA2A2D"); + console.info('ArkUX_Stage_Badge_BorderColor_0600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderColor_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderColor_0700 + * @tc.name Tests the BorderColor property of the badge component + * @tc.desc Sets the BorderColor property parameter to the exception value null + */ + it('ArkUX_Stage_Badge_BorderColor_0700', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderColor_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderColor_0700'); + console.info('ArkUX_Stage_Badge_BorderColor_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderColor_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderColor_0700 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderColor_0700 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderColor).assertEqual("#FFFA2A2D"); + console.info('ArkUX_Stage_Badge_BorderColor_0700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderColor_0700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderColor_0800 + * @tc.name Tests the BorderColor property of the badge component + * @tc.desc Sets the BorderColor property parameter to the exception value undefined + */ + it('ArkUX_Stage_Badge_BorderColor_0800', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderColor_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderColor_0800'); + console.info('ArkUX_Stage_Badge_BorderColor_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderColor_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderColor_0800 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderColor_0800 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderColor).assertEqual("#FFFA2A2D"); + console.info('ArkUX_Stage_Badge_BorderColor_0800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderColor_0800 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderColor_0900 + * @tc.name Tests the BorderColor property of the badge component + * @tc.desc Set the BorderColor property parameter to "rgb(138,43,226)" + * and again to the normal value Color.Pink + */ + it('ArkUX_Stage_Badge_BorderColor_0900', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderColor_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderColor_0900'); + console.info('ArkUX_Stage_Badge_BorderColor_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderColor_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderColor_0900 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderColor_0900 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderColor).assertEqual("#FFFFC0CB"); + console.info('ArkUX_Stage_Badge_BorderColor_0900 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderColor_0900 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderColor_1000 + * @tc.name Tests the BorderColor property of the badge component + * @tc.desc Set the BorderColor property parameter to "rgb(138,43,226)" + * and again set the BorderColor property parameter to the outlier value undefined + */ + it('ArkUX_Stage_Badge_BorderColor_1000', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderColor_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderColor_1000'); + console.info('ArkUX_Stage_Badge_BorderColor_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderColor_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderColor_1000 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderColor_0900 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderColor).assertEqual("#FFFA2A2D"); + console.info('ArkUX_Stage_Badge_BorderColor_1000 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderColor_1000 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderColor_1100 + * @tc.name Tests the BorderColor property of the badge component + * @tc.desc Sets the BorderColor property parameter to the exception value 'bgr(138,43,226)' + */ + it('ArkUX_Stage_Badge_BorderColor_1100', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderColor_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderColor_1100'); + console.info('ArkUX_Stage_Badge_BorderColor_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderColor_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderColor_1100 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderColor_1100 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderColor).assertEqual("#FFFA2A2D"); + console.info('ArkUX_Stage_Badge_BorderColor_1100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderColor_1100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderColor_1200 + * @tc.name Tests the BorderColor property of the badge component + * @tc.desc Sets the BorderColor property parameter to 0x00ff00. + * Sets the universal property backgroundColor property value to Color.Pink + */ + it('ArkUX_Stage_Badge_BorderColor_1200', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderColor_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderColor_1200'); + console.info('ArkUX_Stage_Badge_BorderColor_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderColor_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderColor_1200 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderColor_1200 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_Badge_BorderColor_1200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderColor_1200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderWidth_0100 + * @tc.name Tests the BorderWidth property of the badge component + * @tc.desc Set the BorderWidth property argument to 5 + */ + it('ArkUX_Stage_Badge_BorderWidth_0100', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderWidth_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0100'); + console.info('ArkUX_Stage_Badge_BorderWidth_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderWidth_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderWidth_0100 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderWidth_0100 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderWidth).assertEqual("5.00vp"); + console.info('ArkUX_Stage_Badge_BorderWidth_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderWidth_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderWidth_0200 + * @tc.name Tests the BorderWidth property of the badge component + * @tc.desc Set the BorderWidth property argument to "5" + */ + it('ArkUX_Stage_Badge_BorderWidth_0200', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderWidth_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0200'); + console.info('ArkUX_Stage_Badge_BorderWidth_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderWidth_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderWidth_0200 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderWidth_0200 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderWidth).assertEqual("5.00px"); + console.info('ArkUX_Stage_Badge_BorderWidth_0200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderWidth_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderWidth_0300 + * @tc.name Tests the BorderWidth property of the badge component + * @tc.desc Set the BorderWidth property argument to $r("app.string.badge_Size_test") + */ + it('ArkUX_Stage_Badge_BorderWidth_0300', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderWidth_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0300'); + console.info('ArkUX_Stage_Badge_BorderWidth_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderWidth_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderWidth_0300 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderWidth_0300 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderWidth).assertEqual("7.00vp"); + console.info('ArkUX_Stage_Badge_BorderWidth_0300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderWidth_0300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderWidth_0400 + * @tc.name Tests the BorderWidth property of the badge component + * @tc.desc Sets the BorderWidth property parameter to the exception value "" + */ + it('ArkUX_Stage_Badge_BorderWidth_0400', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderWidth_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0400'); + console.info('ArkUX_Stage_Badge_BorderWidth_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderWidth_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderWidth_0400 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderWidth_0400 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderWidth).assertEqual("0.00vp"); + console.info('ArkUX_Stage_Badge_BorderWidth_0400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderWidth_0400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderWidth_0500 + * @tc.name Tests the BorderWidth property of the badge component + * @tc.desc Sets the BorderWidth property parameter to the exception value null + */ + it('ArkUX_Stage_Badge_BorderWidth_0500', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderWidth_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0500'); + console.info('ArkUX_Stage_Badge_BorderWidth_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderWidth_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderWidth_0500 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderWidth_0500 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderWidth).assertEqual("1.00vp"); + console.info('ArkUX_Stage_Badge_BorderWidth_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderWidth_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderWidth_0600 + * @tc.name Tests the BorderWidth property of the badge component + * @tc.desc Sets the BorderWidth property parameter to the exception value undefined + */ + it('ArkUX_Stage_Badge_BorderWidth_0600', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderWidth_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0600'); + console.info('ArkUX_Stage_Badge_BorderWidth_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderWidth_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderWidth_0600 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderWidth_0600 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderWidth).assertEqual("1.00vp"); + console.info('ArkUX_Stage_Badge_BorderWidth_0600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderWidth_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderWidth_0700 + * @tc.name Tests the BorderWidth property of the badge component + * @tc.desc Set the BorderWidth property parameter to 5, + * and set the BorderWidth property parameter to "7fp" again + */ + it('ArkUX_Stage_Badge_BorderWidth_0700', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderWidth_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0700'); + console.info('ArkUX_Stage_Badge_BorderWidth_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderWidth_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderWidth_0700 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderWidth_0700 component style.borderWidth is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderWidth).assertEqual("7.00fp"); + console.info('ArkUX_Stage_Badge_BorderWidth_0700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderWidth_0700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderWidth_0800 + * @tc.name Tests the BorderWidth property of the badge component + * @tc.desc Set the BorderWidth property parameter to 5 + * and set the BorderWidth property parameter to undefined again + */ + it('ArkUX_Stage_Badge_BorderWidth_0800', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderWidth_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0800'); + console.info('ArkUX_Stage_Badge_BorderWidth_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderWidth_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderWidth_0800 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderWidth_0800 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderWidth).assertEqual("1.00vp"); + console.info('ArkUX_Stage_Badge_BorderWidth_0800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderWidth_0800 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderWidth_0900 + * @tc.name Tests the BorderWidth property of the badge component + * @tc.desc Sets the BorderWidth property parameter to the exception value "asdf%^7" + */ + it('ArkUX_Stage_Badge_BorderWidth_0900', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderWidth_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0900'); + console.info('ArkUX_Stage_Badge_BorderWidth_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderWidth_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderWidth_0900 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderWidth_0900 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderWidth).assertEqual("0.00vp"); + console.info('ArkUX_Stage_Badge_BorderWidth_0900 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderWidth_0900 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderWidth_1000 + * @tc.name Tests the BorderWidth property of the badge component + * @tc.desc Set the BorderWidth property parameter to "5lpx" + * and the common property width property value to the outlier value 7 + */ + it('ArkUX_Stage_Badge_BorderWidth_1000', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderWidth_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_1000'); + console.info('ArkUX_Stage_Badge_BorderWidth_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderWidth_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderWidth_1000 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderWidth_1000 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderWidth).assertEqual("5.00lpx"); + console.info('ArkUX_Stage_Badge_BorderWidth_1000 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderWidth_1000 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderWidth_1100 + * @tc.name Combined test all new attributes of the Badge component + * @tc.desc Set the BorderWidth property argument to 0 + */ + it('ArkUX_Stage_Badge_BorderWidth_1100', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderWidth_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_1100'); + console.info('ArkUX_Stage_Badge_BorderWidth_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderWidth_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderWidth_1100 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderWidth_1100 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderWidth).assertEqual("0.00vp"); + console.info('ArkUX_Stage_Badge_BorderWidth_1100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderWidth_1100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderWidth_1200 + * @tc.name Combined test all new attributes of the Badge component + * @tc.desc Simultaneous setting BorderWidth(5) fontWeight(600) BorderColor(#FFFD0000) + */ + it('ArkUX_Stage_Badge_BorderWidth_1200', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderWidth_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_1200'); + console.info('ArkUX_Stage_Badge_BorderWidth_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderWidth_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderWidth_1200 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderWidth_1200 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderWidth).assertEqual("5.00vp"); + expect(style.fontWeight).assertEqual("FontWeight.600"); + expect(style.borderColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_Badge_BorderWidth_1200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderWidth_1200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Badge_BorderWidth_1300 + * @tc.name Combined test all new attributes of the Badge component + * @tc.desc Do not set new attributes + */ + it('ArkUX_Stage_Badge_BorderWidth_1300', 0, async function (done) { + console.info('ArkUX_Stage_Badge_BorderWidth_1300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_1300'); + console.info('ArkUX_Stage_Badge_BorderWidth_1300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Badge_BorderWidth_1300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Badge_BorderWidth_1300 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Badge_BorderWidth_1300 component obj.$attrs.style is: " + + JSON.stringify(obj.$attrs.style)); + let style = JSON.parse(obj.$attrs.style); + expect(style.borderWidth).assertEqual("1.00vp"); + expect(style.fontWeight).assertEqual("FontWeight.Normal"); + expect(style.borderColor).assertEqual("#FFFA2A2D"); + console.info('ArkUX_Stage_Badge_BorderWidth_1300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Badge_BorderWidth_1300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + }) +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/module.json b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..2b03fde2a1898cf911b3b3f2f94a553bca8ebb86 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/module.json @@ -0,0 +1,41 @@ +{ + "module": { + "name": "phone", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "visible": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/resources/base/element/color.json b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..9ac2ebaad5da8e560199ac0535319b42c3d1a5f2 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/resources/base/element/color.json @@ -0,0 +1,16 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "Divider_color", + "value": "#000000" + }, + { + "name": "badge_BorderColor", + "value": "#FFFD0000" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..7bfb9a770c2198733f68b4def0a92e2432aa0d15 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + }, + { + "name": "Divider_width", + "value": "10px" + }, + { + "name": "Divider_startMargin", + "value": "5px" + }, + { + "name": "Divider_endMargin", + "value": "5px" + }, + { + "name": "badge_Size_test", + "value": "7vp" + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/resources/base/media/icon.png b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/resources/base/media/icon.png rename to arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/resources/base/media/icon.png diff --git a/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/resources/base/profile/test_pages.json b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/resources/base/profile/test_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..77e90731b5a38d861663029b483df3d3ac9ec74b --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "TestAbility/pages/Index" + ] +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_button/AppScope/app.json b/arkui/ace_ets_components_ux/ace_ets_component_button/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..d0c249d2db23564e7864f34c477dfac70503eec5 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_button/AppScope/app.json @@ -0,0 +1,19 @@ +{ + "app": { + "bundleName": "com.example.buttontest", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_button/AppScope/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_button/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..30af7cfee6766dda361b893d1565490dc145fdf0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_button/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"MyApplication" + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_components_ux/ace_ets_component_button/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from ability/ability_runtime/non_concurrent/actsthirdapponerelytest/AppScope/resources/base/media/app_icon.png rename to arkui/ace_ets_components_ux/ace_ets_component_button/AppScope/resources/base/media/app_icon.png diff --git a/arkui/ace_ets_components_ux/ace_ets_component_button/BUILD.gn b/arkui/ace_ets_components_ux/ace_ets_component_button/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..0fd8a279a6e8e56665b1bf8af04b9f396e0e3248 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_button/BUILD.gn @@ -0,0 +1,43 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAceButtonTest") { + hap_profile = "src/main/module.json" + js_build_mode = "debug" + deps = [ + ":ace_ets_component_button_js_assets", + ":ace_ets_component_button_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsAceButtonTest" + part_name = "ace_engine" + subsystem_name = "arkui" +} + +ohos_app_scope("ace_ets_component_button_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("ace_ets_component_button_js_assets") { + source_dir = "src/main/ets" +} + +ohos_resources("ace_ets_component_button_resources") { + sources = [ "src/main/resources" ] + deps = [ ":ace_ets_component_button_profile" ] + hap_profile = "src/main/module.json" +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_button/Test.json b/arkui/ace_ets_components_ux/ace_ets_component_button/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..d058d812ace4059a0870d91a93bdcbcdb0a85751 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_button/Test.json @@ -0,0 +1,26 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "600000", + "bundle-name": "com.example.buttontest", + "module-name": "phone", + "shell-timeout": "600000", + "testcase-timeout": 240000 + }, + "kits": [{ + "test-file-name": [ + "ActsAceButtonTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "power-shell wakeup", + "power-shell setmode 602" + ] + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_button/signature/openharmony_sx.p7b b/arkui/ace_ets_components_ux/ace_ets_component_button/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..379a3d1416ce2fb5e2991095a8c154496fa5920e Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_button/signature/openharmony_sx.p7b differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/TestAbility/TestAbility.ets b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/TestAbility/TestAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d65dd2ea8346a8b5d12ac7aff026197a95abaea --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/TestAbility/TestAbility.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import Ability from '@ohos.app.ability.UIAbility' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import testsuite from '../test/List.test' +import Window from '@ohos.window' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('TestAbility/pages/Index', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/TestAbility/pages/Index.ets b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/TestAbility/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..f4794fd586c10cbf557ceef09a025db919e817db --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/TestAbility/pages/Index.ets @@ -0,0 +1,361 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +//@ts-nocheck +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import hilog from '@ohos.hilog'; +import testsuite from '../../test/List.test' +@Entry +@Component +struct textInputTest { + aboutToAppear(){ + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + @State txtA: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtB: string = 'overflowTextOverlengthTextOverflow.Ellipsis'; + @State txtC: string = 'overflowTextOverlengthTextOverflow.None'; + @State txtD: string = 'overflowTextOverflow.Race'; + @State txtE: string = 'overflowTextOverflow.MultilineClip'; + @State txtF: string = 'overflowTextOverflow.MultilineEllipsis'; + @State txtG: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtH: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtI: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtJ: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtK: string = 'overfloTextOverlengthTextOverflow.Clip'; + @State txtL: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtM: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtN: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtO: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtP: string = 'overflowTextOverlengthTextOverflow.Clipe'; + @State txtQ: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtR: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtS: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtT: string = 'overflowTextOverlengthTextOverflow.Clipe'; + @State txtU: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtV: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtW: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtX: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtY: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtZ: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txta: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtb: string = 'overflowTextOverlengthTextOverflow.Clip'; + @State txtc: string = 'overflowTextOverlength TextOverflow.Clip'; + @State txtd: string = 'overflowTextOverlength TextOverflow.Clip'; + @State widthLongSize: number = 300; + @State widthShortSize: number = 200; + @State colorInfo: string = "#f2eada"; + private scroller: Scroller = new Scroller() + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Column }) { + + Text('ArkUX_Stage_Button_LabelStyle_0100').fontSize(15).margin({top:20}) + Button(this.txtA) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MaxLines, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } + }) + .key("ArkUX_Stage_Button_LabelStyle_0100") + + Text('ArkUX_Stage_Button_LabelStyle_0200').fontSize(15).margin({top:20}) + Button(this.txtB) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 3, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MaxLines, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_0200") + + Text('ArkUX_Stage_Button_LabelStyle_0300').fontSize(15).margin({top:20}) + Button(this.txtC) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MinFontSize, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_0300") + + Text('ArkUX_Stage_Button_LabelStyle_0400').fontSize(15).margin({top:20}) + Button(this.txtD) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MinFontSize, + font: { weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Normal } }) + .key("ArkUX_Stage_Button_LabelStyle_0400") + + Text('ArkUX_Stage_Button_LabelStyle_0500').fontSize(15).margin({top:20}) + Button(this.txtE) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 3, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.LayoutConstraint, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_0500") + + Text('ArkUX_Stage_Button_LabelStyle_0600').fontSize(15).margin({top:20}) + Button(this.txtF) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Ellipsis, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MaxLines, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_0600") + + Text('ArkUX_Stage_Button_LabelStyle_0700').fontSize(15).margin({top:20}) + Button(this.txtG) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Ellipsis, + maxLines: 3, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MaxLines, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_0700") + + Text('ArkUX_Stage_Button_LabelStyle_0800').fontSize(15).margin({top:20}) + Button(this.txtH) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Ellipsis, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MinFontSize, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_0800") + + Text('ArkUX_Stage_Button_LabelStyle_0900').fontSize(15).margin({top:20}) + Button(this.txtI) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Ellipsis, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MinFontSize, + font: { weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Normal } }) + .key("ArkUX_Stage_Button_LabelStyle_0900") + + Text('ArkUX_Stage_Button_LabelStyle_1000').fontSize(15).margin({top:20}) + Button(this.txtJ) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Ellipsis, + maxLines: 3, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.LayoutConstraint, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_1000") + + Text('ArkUX_Stage_Button_LabelStyle_1100').fontSize(15).margin({top:20}) + Button(this.txtK) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.None, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MaxLines, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_1100") + + Text('ArkUX_Stage_Button_LabelStyle_1200').fontSize(15).margin({top:20}) + Button(this.txtL) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.None, + maxLines: 3, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MaxLines, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_1200") + + Text('ArkUX_Stage_Button_LabelStyle_1300').fontSize(15).margin({top:20}) + Button(this.txtM) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.None, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MinFontSize, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_1300") + + Text('ArkUX_Stage_Button_LabelStyle_1400').fontSize(15).margin({top:20}) + Button(this.txtN) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.None, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MinFontSize, + font: { weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Normal } }) + .key("ArkUX_Stage_Button_LabelStyle_1400") + + Text('ArkUX_Stage_Button_LabelStyle_1500').fontSize(15).margin({top:20}) + Button(this.txtO) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.None, + maxLines: 3, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.LayoutConstraint, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_1500") + + Text('ArkUX_Stage_Button_LabelStyle_1600').fontSize(15).margin({top:20}) + Button(this.txtP) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Ellipsis, + maxLines: 1 }) + .key("ArkUX_Stage_Button_LabelStyle_1600") + + Text('ArkUX_Stage_Button_LabelStyle_1700').fontSize(15).margin({top:20}) + Button(this.txtQ) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Ellipsis, + minFontSize: 5 }) + .key("ArkUX_Stage_Button_LabelStyle_1700") + + Text('ArkUX_Stage_Button_LabelStyle_1800').fontSize(15).margin({top:20}) + Button(this.txtR) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Ellipsis, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MaxLines + }) + .key("ArkUX_Stage_Button_LabelStyle_1800") + + Text('ArkUX_Stage_Button_LabelStyle_1900').fontSize(15).margin({top:20}) + Button(this.txtS) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Ellipsis, + font: { size: 15, weight: FontWeight.Medium, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_1900") + + Text('ArkUX_Stage_Button_LabelStyle_2000').fontSize(15).margin({top:20}) + Button(this.txtT) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Ellipsis }) + .key("ArkUX_Stage_Button_LabelStyle_2000") + + Text('ArkUX_Stage_Button_LabelStyle_2100').fontSize(15).margin({top:20}) + Button(this.txtU) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MaxLines, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_2100") + + Text('ArkUX_Stage_Button_LabelStyle_2200').fontSize(15).margin({top:20}) + Button(this.txtV) + .width(this.widthShortSize) + .key("ArkUX_Stage_Button_LabelStyle_2200") + + Text('ArkUX_Stage_Button_LabelStyle_2300').fontSize(15).margin({top:20}) + Button(this.txtW) + .width(this.widthLongSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MaxLines, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_2300") + + Text('ArkUX_Stage_Button_LabelStyle_2400').fontSize(15).margin({top:20}) + Button(this.txtX) + .width(this.widthLongSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Ellipsis, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MaxLines, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_2400") + + Text('ArkUX_Stage_Button_LabelStyle_2500').fontSize(15).margin({top:20}) + Button(this.txtY) + .width(this.widthLongSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.None, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MaxLines, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_2500") + + Text('ArkUX_Stage_Button_LabelStyle_2600').fontSize(15).margin({top:20}) + Button(this.txtZ) + .width(this.widthLongSize) + .key("ArkUX_Stage_Button_LabelStyle_2600") + + Text('ArkUX_Stage_Button_LabelStyle_2700').fontSize(15).margin({top:20}) + Button(this.txta) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: null, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MaxLines, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_2700") + + Text('ArkUX_Stage_Button_LabelStyle_2800').fontSize(15).margin({top:20}) + Button(this.txtb) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: 0, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MaxLines, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_2800") + + Text('ArkUX_Stage_Button_LabelStyle_2900').fontSize(15).margin({top:20}) + Button(this.txtc,{ type: ButtonType.Capsule, stateEffect: false }).opacity(0.4) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MaxLines, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_2900") + + Text('ArkUX_Stage_Button_LabelStyle_3000').fontSize(15).margin({top:20}) + Button(this.txtd) + .width(this.widthShortSize) + // @ts-ignore + .labelStyle({ overflow: TextOverflow.Race, + maxLines: 1, minFontSize: 5, + heightAdaptivePolicy:TextHeightAdaptivePolicy.MaxLines, + font: { size: 15, weight: FontWeight.Bolder, family: 'cursive', style: FontStyle.Italic } }) + .key("ArkUX_Stage_Button_LabelStyle_3000") + } + } + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.Auto }) + } + } + .width('100%') + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6c662824093f9339085214d247c6247faa86ae9 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s it', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${targetParams} ${key} ${parameters[key]}` + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/test/List.test.ets b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..2ffbca67d5a3dfb146178110217e7448e9a28dd7 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import buttonTest from './button' + +export default function testsuite() { + buttonTest() +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/test/button.ets b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/test/button.ets new file mode 100644 index 0000000000000000000000000000000000000000..0281b01f2982922a2a6946e3d5ff7ec728930020 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/test/button.ets @@ -0,0 +1,914 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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, beforeEach, afterEach, it, expect } from '@ohos/hypium' +let emitKey = "emitUserAgent"; +export default function buttonTest() { + describe('ActsButtonTest', function () { + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_0100 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Clip,maxLines to 1, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.maxLines,set the font + * parameter size to 15, weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_0100', 0, async function (done) { + console.info('ArkUX_FA_Button_TextOverFlow_0100 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_0100'); + console.info('ArkUX_Stage_Button_LabelStyle_0100 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_0100 component obj.$attrs.labelStyle is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_0100 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Clip"); + console.info('ArkUX_Stage_Button_LabelStyle_0100 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_0100 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_0200 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Clip,maxLines to 3, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.maxLines,set the font parameter + * size to 15,weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_0200', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_0200 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_0200'); + console.info('ArkUX_Stage_Button_LabelStyle_0200 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_0200 component obj.$attrs.fontWeight is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_0200 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Clip"); + console.info('ArkUX_Stage_Button_LabelStyle_0200 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_0200 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_0300 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Clip,maxLines to 3, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.MinFontSize,set the font + * parameter size to 15, weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_0300', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_0300 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_0300'); + console.info('ArkUX_Stage_Button_LabelStyle_0300 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_0300 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_0300 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Clip"); + console.info('ArkUX_Stage_Button_LabelStyle_0300 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_0300 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_0400 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Clip,maxLines to 1, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.MinFontSize,set the font + * parameter weight to FontWeight.Normal,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_0400', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_0400 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_0400'); + console.info('ArkUX_Stage_Button_LabelStyle_0400 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_0400 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_0400 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Clip"); + console.info('ArkUX_Stage_Button_LabelStyle_0400 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_0400 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_0500 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Clip,maxLines to 3, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.LayoutConstraint,set the font + * parameter size to 15, weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_0500', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_0500 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_0500'); + console.info('ArkUX_Stage_Button_LabelStyle_0500 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_0500 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_0500 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Clip"); + console.info('ArkUX_Stage_Button_LabelStyle_0500 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_0500 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_0600 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Ellipsis,maxLines to 1, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.maxLines,set the font parameter + * size to 15, weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_0600', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_0600 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_0600'); + console.info('ArkUX_Stage_Button_LabelStyle_0600 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_0600 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_0600 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Ellipsis"); + console.info('ArkUX_Stage_Button_LabelStyle_0600 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_0600 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_0700 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Ellipsis,maxLines to 3, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.maxLines,set the font parameter + * size to 15, weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_0700', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_0700 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_0700'); + console.info('ArkUX_Stage_Button_LabelStyle_0700 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_0700 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_0700 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Ellipsis"); + console.info('ArkUX_Stage_Button_LabelStyle_0700 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_0700 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_0800 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Ellipsis,maxLines to 3, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.MinFontSize,set the font + * parameter size to 15, weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_0800', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_0800 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_0800'); + console.info('ArkUX_Stage_Button_LabelStyle_0800 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_0800 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_0800 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Ellipsis"); + console.info('ArkUX_Stage_Button_LabelStyle_0800 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_0800 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_0900 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Ellipsis,maxLines to 1, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.MinFontSize, + * set the font parameter weight to FontWeight.Normal,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_0900', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_0900 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_0900'); + console.info('ArkUX_Stage_Button_LabelStyle_0900 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_0900 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_0900 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Ellipsis"); + console.info('ArkUX_Stage_Button_LabelStyle_0900 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_0900 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_1000 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Ellipsis,maxLines to 3, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.LayoutConstraint,set the font + * parameter size to 15,weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_1000', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_1000 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_1000'); + console.info('ArkUX_Stage_Button_LabelStyle_1000 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_1000 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_1000 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Ellipsis"); + console.info('ArkUX_Stage_Button_LabelStyle_1000 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_1000 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_1100 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.None,maxLines to 1, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.maxLines,set the font parameter + * size to 15, weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_1100', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_1100 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_1100'); + console.info('ArkUX_Stage_Button_LabelStyle_1100 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_1100 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_1100 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.None"); + console.info('ArkUX_Stage_Button_LabelStyle_1100 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_1100 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_1200 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.None,maxLines to 3, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.maxLines,set the font parameter + * size to 15,weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_1200', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_1200 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_1200'); + console.info('ArkUX_Stage_Button_LabelStyle_1200 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_1200 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_1200 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.None"); + console.info('ArkUX_Stage_Button_LabelStyle_1200 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_1200 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_1300 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.None,maxLines to 3, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.MinFontSize,set the font + * parameter size to 15,weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_1300', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_1300 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_1300'); + console.info('ArkUX_Stage_Button_LabelStyle_1300 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_1300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_1300 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_1300 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.None"); + console.info('ArkUX_Stage_Button_LabelStyle_1300 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_1300 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_1400 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.None,maxLines to 1, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.MinFontSize, + * set the font parameter weight to FontWeight.Normal,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_1400', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_1400 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_1400'); + console.info('ArkUX_Stage_Button_LabelStyle_1400 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_1400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_1400 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_1400 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.None"); + console.info('ArkUX_Stage_Button_LabelStyle_1400 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_1400 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_1500 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.None,maxLines to 3, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.LayoutConstraint,set the font + * parameter size to 15,weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_1500', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_1500 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_1500'); + console.info('ArkUX_Stage_Button_LabelStyle_1500 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_1500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_1500 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_1500 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.None"); + console.info('ArkUX_Stage_Button_LabelStyle_1500 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_1500 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_1600 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Ellipsis,maxLines to 1 + */ + it('ArkUX_Stage_Button_LabelStyle_1600', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_1600 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_1600'); + console.info('ArkUX_Stage_Button_LabelStyle_1600 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_1600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_1600 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_1600 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Ellipsis"); + console.info('ArkUX_Stage_Button_LabelStyle_1600 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_1600 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_1700 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Ellipsis,minFontSize to 5 + */ + it('ArkUX_Stage_Button_LabelStyle_1700', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_1700 START'); + setTimeout(()=>{ + try{ + console.info('ArkUX_Stage_Button_LabelStyle_1700 START 111'); + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_1700'); + console.info('ArkUX_Stage_Button_LabelStyle_1700 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_1700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_1700 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_1700 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Ellipsis"); + console.info('ArkUX_Stage_Button_LabelStyle_1700 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_1700 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_1800 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Ellipsis, + * heightAdaptivePolicy to TextHeightAdaptivePolicy.maxLines + */ + it('ArkUX_Stage_Button_LabelStyle_1800', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_1800 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_1800'); + console.info('ArkUX_Stage_Button_LabelStyle_1800 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_1800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_1800 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_1800 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Ellipsis"); + console.info('ArkUX_Stage_Button_LabelStyle_1800 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_1800 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_1900 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Ellipsis, + * set the font parameter size to 15, weight to FontWeight.Bolder,family to cursive,style + * to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_1900', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_1900 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_1900'); + console.info('ArkUX_Stage_Button_LabelStyle_1900 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_1900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_1900 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_1900 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Ellipsis"); + console.info('ArkUX_Stage_Button_LabelStyle_1900 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_1900 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_2000 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Ellipsis + */ + it('ArkUX_Stage_Button_LabelStyle_2000', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_2000 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_2000'); + console.info('ArkUX_Stage_Button_LabelStyle_2000 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_2000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_2000 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_2000 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Ellipsis"); + console.info('ArkUX_Stage_Button_LabelStyle_2000 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_2000 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_2100 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter maxLines to 1,minFontSize to 5, + * heightAdaptivePolicy to TextHeightAdaptivePolicy.maxLines,set the font parameter size to 15, + * weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_2100', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_2100 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_2100'); + console.info('ArkUX_Stage_Button_LabelStyle_2100 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_2100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_2100 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_2100 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Clip"); + console.info('ArkUX_Stage_Button_LabelStyle_2100 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_2100 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_2200 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc The labelStyle parameter is not set + */ + it('ArkUX_Stage_Button_LabelStyle_2200', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_2200 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_2200'); + console.info('ArkUX_Stage_Button_LabelStyle_2200 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_2200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_2200 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_2200 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Clip"); + console.info('ArkUX_Stage_Button_LabelStyle_2200 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_2200 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_2300 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Clip,maxLines to 1, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.maxLines,set the font parameter + * size to 15, weight to FontWeight.Bolder,family to cursive, s + * tyle to FontStyle.Italic(Not overlength) + */ + it('ArkUX_Stage_Button_LabelStyle_2300', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_2300 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_2300'); + console.info('ArkUX_Stage_Button_LabelStyle_2300 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_2300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_2300 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_2300 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Clip"); + console.info('ArkUX_Stage_Button_LabelStyle_2300 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_2300 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_2400 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Ellipsis,maxLines to 1, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.maxLines,set the font parameter + * size to 15, weight to FontWeight.Bolder,family to cursive, + * style to FontStyle.Italic(Not overlength) + */ + it('ArkUX_Stage_Button_LabelStyle_2400', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_2400 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_2400'); + console.info('ArkUX_Stage_Button_LabelStyle_2400 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_2400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_2400 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_2400 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Ellipsis"); + console.info('ArkUX_Stage_Button_LabelStyle_2400 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_2400 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_2500 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.None,maxLines to 1, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.maxLines,set the font parameter + * size to 15, weight to FontWeight.Bolder,family to cursive, style to + * FontStyle.Italic(Not overlength) + */ + it('ArkUX_Stage_Button_LabelStyle_2500', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_2500 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_2500'); + console.info('ArkUX_Stage_Button_LabelStyle_2500 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_2500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_2500 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_2500 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.None"); + console.info('ArkUX_Stage_Button_LabelStyle_2500 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_2500 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_2600 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc The labelStyle parameter is not set(Not overlength) + */ + it('ArkUX_Stage_Button_LabelStyle_2600', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_2600 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_2600'); + console.info('ArkUX_Stage_Button_LabelStyle_2600 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_2600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_2600 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_2600 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Clip"); + console.info('ArkUX_Stage_Button_LabelStyle_2600 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_2600 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_2700 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to null,maxLines to 1,minFontSize to 5, + * heightAdaptivePolicy to TextHeightAdaptivePolicy.maxLines,set the font parameter size to 15, + * weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic(Not overlength) + */ + it('ArkUX_Stage_Button_LabelStyle_2700', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_2700 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_2700'); + console.info('ArkUX_Stage_Button_LabelStyle_2700 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_2700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_2700 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_2700 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Clip"); + console.info('ArkUX_Stage_Button_LabelStyle_2700 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_2700 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_2800 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to 0,maxLines to 1,minFontSize to 5, + * heightAdaptivePolicy to TextHeightAdaptivePolicy.maxLines,set the font parameter size to 15, + * weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic(Not overlength) + */ + it('ArkUX_Stage_Button_LabelStyle_2800', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_2800 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_2800'); + console.info('ArkUX_Stage_Button_LabelStyle_2800 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_2800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_2800 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_2800 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.None"); + console.info('ArkUX_Stage_Button_LabelStyle_2800 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_2800 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_2900 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Clip",maxLines to 1, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.maxLines,set the font parameter + * size to 15, weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic,set the + * stateEffect parameter to false + */ + it('ArkUX_Stage_Button_LabelStyle_2900', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_2900 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_2900'); + console.info('ArkUX_Stage_Button_LabelStyle_2900 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_2900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_2900 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_2900 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Clip"); + console.info('ArkUX_Stage_Button_LabelStyle_2900 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_2900 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /** + * @tc.number ArkUX_Stage_Button_LabelStyle_3000 + * @tc.name Tests the labelStyle property of the button component + * @tc.desc Set labelStyle Set the labelStyle parameter overflow to TextOverflow.Race",maxLines to 1, + * minFontSize to 5,heightAdaptivePolicy to TextHeightAdaptivePolicy.maxLines,set the font parameter + * size to 15, weight to FontWeight.Bolder,family to cursive, style to FontStyle.Italic + */ + it('ArkUX_Stage_Button_LabelStyle_3000', 0, async function (done) { + console.info('ArkUX_Stage_Button_LabelStyle_3000 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Button_LabelStyle_3000'); + console.info('ArkUX_Stage_Button_LabelStyle_3000 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Button_LabelStyle_3000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Button_LabelStyle_3000 component obj.$attrs.textOverflow is: " + + JSON.stringify(obj.$attrs.labelStyle)); + let labelStyle = JSON.parse(obj.$attrs.labelStyle) + console.info("ArkUX_Stage_Button_LabelStyle_3000 component obj.$attrs.labelStyle is: " + + JSON.stringify(labelStyle)); + expect(labelStyle.overflow).assertEqual("TextOverflow.Clip"); + console.info('ArkUX_Stage_Button_LabelStyle_3000 END '); + } catch(err) { + expect().assertFail() + console.info('ArkUX_Stage_Button_LabelStyle_3000 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + }) +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/module.json b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..2b03fde2a1898cf911b3b3f2f94a553bca8ebb86 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/module.json @@ -0,0 +1,41 @@ +{ + "module": { + "name": "phone", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "visible": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/resources/base/element/color.json b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..586382563057582bb7de7372322564c1487fece1 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/resources/base/element/color.json @@ -0,0 +1,16 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "Divider_color", + "value": "#000000" + }, + { + "name": "TextInput_Color", + "value": "#FFFD0000" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..3ca01713ce9bb325f92762c293ef26039e9c5eab --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + }, + { + "name": "Divider_width", + "value": "10px" + }, + { + "name": "Divider_startMargin", + "value": "5px" + }, + { + "name": "Divider_endMargin", + "value": "5px" + }, + { + "name": "textInput_Size_test", + "value": "4" + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/resources/base/media/icon.png b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/resources/base/media/icon.png rename to arkui/ace_ets_components_ux/ace_ets_component_button/src/main/resources/base/media/icon.png diff --git a/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/resources/base/profile/test_pages.json b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/resources/base/profile/test_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..77e90731b5a38d861663029b483df3d3ac9ec74b --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "TestAbility/pages/Index" + ] +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/AppScope/app.json b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..22cca025fa701df9054283f28278a3dbf6bbffbf --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/AppScope/app.json @@ -0,0 +1,19 @@ +{ + "app": { + "bundleName": "com.example.checkboxtest", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/AppScope/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..30af7cfee6766dda361b893d1565490dc145fdf0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"MyApplication" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/AppScope/resources/base/media/app_icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/BUILD.gn b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..83ebb7e6ea03b5bd802a9838d1a027140e354970 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/BUILD.gn @@ -0,0 +1,43 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAceCheckboxTest") { + hap_profile = "src/main/module.json" + js_build_mode = "debug" + deps = [ + ":ace_ets_component_checkbox_js_assets", + ":ace_ets_component_checkbox_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsAceCheckboxTest" + part_name = "ace_engine" + subsystem_name = "arkui" +} + +ohos_app_scope("ace_ets_component_checkbox_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("ace_ets_component_checkbox_js_assets") { + source_dir = "src/main/ets" +} + +ohos_resources("ace_ets_component_checkbox_resources") { + sources = [ "src/main/resources" ] + deps = [ ":ace_ets_component_checkbox_profile" ] + hap_profile = "src/main/module.json" +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/Test.json b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..2697a8bcb0202fec939f1a658c2b2b01f1aadf7a --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/Test.json @@ -0,0 +1,26 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "600000", + "bundle-name": "com.example.checkboxtest", + "module-name": "phone", + "shell-timeout": "600000", + "testcase-timeout": 240000 + }, + "kits": [{ + "test-file-name": [ + "ActsAceCheckboxTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "power-shell wakeup", + "power-shell setmode 602" + ] + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/signature/openharmony_sx.p7b b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 74% rename from ability/ability_runtime/non_concurrent/actsthirdapponerelytest/signature/openharmony_sx.p7b rename to arkui/ace_ets_components_ux/ace_ets_component_checkbox/signature/openharmony_sx.p7b index a17c87cfc0e75981bfd604b8640a24ba00d0921a..af53e10d598ee2d347c020d9cc141b2bda44af95 Binary files a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/signature/openharmony_sx.p7b and b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/signature/openharmony_sx.p7b differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestAbility/TestAbility.ets b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestAbility/TestAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d65dd2ea8346a8b5d12ac7aff026197a95abaea --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestAbility/TestAbility.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import Ability from '@ohos.app.ability.UIAbility' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import testsuite from '../test/List.test' +import Window from '@ohos.window' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('TestAbility/pages/Index', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestAbility/pages/CheckBox.ets b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestAbility/pages/CheckBox.ets new file mode 100644 index 0000000000000000000000000000000000000000..b2ff24e6c28785d59e839f0dcf06b91a9298858e --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestAbility/pages/CheckBox.ets @@ -0,0 +1,563 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + //@ts-nocheck +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import hilog from '@ohos.hilog'; +import testsuite from '../../test/List.test' +@Entry +@Component +struct checkBoxTest { + + aboutToAppear(){ + } + + build() { + Row() { + Column() { + List({space: 0, initialIndex: 0 }){ + ListItem(){ + Checkbox({name: 'checkbox1', group: 'checkboxGroup1'}) + .key("ArkUX_Stage_Checkbox_unselectedColor_0100") + .select(false) + .selectedColor(0xed6f21) + .unselectedColor(0x00ff00) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox2', group: 'checkboxGroup1'}) + .key("ArkUX_Stage_Checkbox_unselectedColor_0200") + .select(false) + .selectedColor(0xed6f21) + .unselectedColor("#fffd0000") + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox3', group: 'checkboxGroup1'}) + .key("ArkUX_Stage_Checkbox_unselectedColor_0300") + .select(false) + .selectedColor(0xed6f21) + .unselectedColor("rgb(138,43,226)") + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox4', group: 'checkboxGroup2'}) + .key("ArkUX_Stage_Checkbox_unselectedColor_0400") + .select(false) + .selectedColor(0xed6f21) + .unselectedColor(Color.Pink) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox5', group: 'checkboxGroup2'}) + .key("ArkUX_Stage_Checkbox_unselectedColor_0500") + .select(false) + .selectedColor(0xed6f21) + .unselectedColor($r("app.color.checkbox_Color")) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox6', group: 'checkboxGroup2'}) + .key("ArkUX_Stage_Checkbox_unselectedColor_0600") + .select(false) + .selectedColor(0xed6f21) + .unselectedColor("") + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox7', group: 'checkboxGroup3'}) + .key("ArkUX_Stage_Checkbox_unselectedColor_0700") + .select(false) + .selectedColor(0xed6f21) + .unselectedColor(null) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox8', group: 'checkboxGroup3'}) + .key("ArkUX_Stage_Checkbox_unselectedColor_0800") + .select(false) + .selectedColor(0xed6f21) + .unselectedColor(undefined) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox9', group: 'checkboxGroup3'}) + .key("ArkUX_Stage_Checkbox_unselectedColor_0900") + .select(false) + .selectedColor(0xed6f21) + .unselectedColor(Color.Pink) + .unselectedColor("#FFFD0000") + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox10', group: 'checkboxGroup13'}) + .key("ArkUX_Stage_Checkbox_unselectedColor_1000") + .select(false) + .selectedColor(0xed6f21) + .unselectedColor(Color.Pink) + .unselectedColor(undefined) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox11', group: 'checkboxGroup13'}) + .key("ArkUX_Stage_Checkbox_unselectedColor_1100") + .select(false) + .selectedColor(0xed6f21) + .unselectedColor('bgr(138,43,226)') + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox12', group: 'checkboxGroup13'}) + .key("ArkUX_Stage_Checkbox_unselectedColor_1200") + .select(false) + .selectedColor(0xed6f21) + .unselectedColor(0x00ff00) + .backgroundColor(null) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox13', group: 'checkboxGroup14'}) + .key("ArkUX_Stage_Checkbox_CheckMarkColor_0100") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeColor:0x00ff00}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox14', group: 'checkboxGroup14'}) + .key("ArkUX_Stage_Checkbox_CheckMarkColor_0200") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeColor:"#fffd0000"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox15', group: 'checkboxGroup14'}) + .key("ArkUX_Stage_Checkbox_CheckMarkColor_0300") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeColor:"rgb(138,43,226)"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox16', group: 'checkboxGroup15'}) + .key("ArkUX_Stage_Checkbox_CheckMarkColor_0400") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeColor:Color.Pink}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox17', group: 'checkboxGroup15'}) + .key("ArkUX_Stage_Checkbox_CheckMarkColor_0500") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeColor:$r("app.color.checkbox_Color")}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox18', group: 'checkboxGroup15'}) + .key("ArkUX_Stage_Checkbox_CheckMarkColor_0600") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeColor:""}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox19', group: 'checkboxGroup25'}) + .key("ArkUX_Stage_Checkbox_CheckMarkColor_0700") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeColor:null}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox20', group: 'checkboxGroup25'}) + .key("ArkUX_Stage_Checkbox_CheckMarkColor_0800") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeColor:undefined}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox21', group: 'checkboxGroup25'}) + .key("ArkUX_Stage_Checkbox_CheckMarkColor_0900") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeColor:Color.Pink}) + .mark({strokeColor:"#FFFD0000"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox22', group: 'checkboxGroup26'}) + .key("ArkUX_Stage_Checkbox_CheckMarkColor_1000") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeColor:Color.Pink}) + .mark({strokeColor:'bgr(138,43,226)'}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox23', group: 'checkboxGroup26'}) + .key("ArkUX_Stage_Checkbox_CheckMarkColor_1100") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeColor:'bgr(138,43,226)'}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox24', group: 'checkboxGroup26'}) + .key("ArkUX_Stage_Checkbox_CheckMarkColor_1200") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeColor:0x00ff00}) + .backgroundColor(null) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox25', group: 'checkboxGroup27'}) + .key("ArkUX_Stage_Checkbox_CheckMarkSize_0100") + .select(true) + .selectedColor(0xed6f21) + .mark({size:0}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox26', group: 'checkboxGroup27'}) + .key("ArkUX_Stage_Checkbox_CheckMarkSize_0200") + .select(true) + .selectedColor(0xed6f21) + .mark({size:1}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox27', group: 'checkboxGroup27'}) + .key("ArkUX_Stage_Checkbox_CheckMarkSize_0300") + .select(true) + .selectedColor(0xed6f21) + .mark({size:"60px"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox28', group: 'checkboxGroup38'}) + .key("ArkUX_Stage_Checkbox_CheckMarkSize_0400") + .select(true) + .selectedColor(0xed6f21) + .mark({size:"120%"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox29', group: 'checkboxGroup38'}) + .key("ArkUX_Stage_Checkbox_CheckMarkSize_0500") + .select(true) + .selectedColor(0xed6f21) + .mark({size:$r("app.string.Check_Mark_Size_test")}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox30', group: 'checkboxGroup38'}) + .key("ArkUX_Stage_Checkbox_CheckMarkSize_0600") + .select(true) + .selectedColor(0xed6f21) + .mark({size:""}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox31', group: 'checkboxGroup39'}) + .key("ArkUX_Stage_Checkbox_CheckMarkSize_0700") + .select(true) + .selectedColor(0xed6f21) + .mark({size:null}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox32', group: 'checkboxGroup39'}) + .key("ArkUX_Stage_Checkbox_CheckMarkSize_0800") + .select(true) + .selectedColor(0xed6f21) + .mark({size:undefined}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox33', group: 'checkboxGroup39'}) + .key("ArkUX_Stage_Checkbox_CheckMarkSize_0900") + .select(true) + .selectedColor(0xed6f21) + .mark({size:10}) + .mark({size:"40fp"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox34', group: 'checkboxGroup40'}) + .key("ArkUX_Stage_Checkbox_CheckMarkSize_1000") + .select(true) + .selectedColor(0xed6f21) + .mark({size:10}) + .mark({size:undefined}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox35', group: 'checkboxGroup40'}) + .key("ArkUX_Stage_Checkbox_CheckMarkSize_1100") + .select(true) + .selectedColor(0xed6f21) + .mark({size:"asdf#$8"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox36', group: 'checkboxGroup40'}) + .key("ArkUX_Stage_Checkbox_CheckMarkSize_1200") + .select(true) + .selectedColor(0xed6f21) + .mark({size: "10lpx" }) + .size(null) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox36', group: 'checkboxGroup40'}) + .key("ArkUX_Stage_Checkbox_CheckMarkSize_1300") + .select(true) + .selectedColor(0xed6f21) + .mark({size:-10}) + .size(null) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox37', group: 'checkboxGroup'}) + .key("ArkUX_Stage_Checkbox_CheckMarkWidth_0100") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeWidth:0}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox38', group: 'checkboxGroup'}) + .key("ArkUX_Stage_Checkbox_CheckMarkWidth_0200") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeWidth:1}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox39', group: 'checkboxGroup'}) + .key("ArkUX_Stage_Checkbox_CheckMarkWidth_0300") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeWidth:"60px"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox40', group: 'checkboxGroup'}) + .key("ArkUX_Stage_Checkbox_CheckMarkWidth_0400") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeWidth:"120%"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox41', group: 'checkboxGroup'}) + .key("ArkUX_Stage_Checkbox_CheckMarkWidth_0500") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeWidth:$r("app.string.Check_Mark_Size_test")}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox42', group: 'checkboxGroup'}) + .key("ArkUX_Stage_Checkbox_CheckMarkWidth_0600") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeWidth:""}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox43', group: 'checkboxGroup'}) + .key("ArkUX_Stage_Checkbox_CheckMarkWidth_0700") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeWidth:null}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox44', group: 'checkboxGroup'}) + .key("ArkUX_Stage_Checkbox_CheckMarkWidth_0800") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeWidth:undefined}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox45', group: 'checkboxGroup'}) + .key("ArkUX_Stage_Checkbox_CheckMarkWidth_0900") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeWidth:10}) + .mark({strokeWidth:"5fp"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox46', group: 'checkboxGroup'}) + .key("ArkUX_Stage_Checkbox_CheckMarkWidth_1000") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeWidth:10}) + .mark({strokeWidth:undefined}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox47', group: 'checkboxGroup'}) + .key("ArkUX_Stage_Checkbox_CheckMarkWidth_1100") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeWidth:"asdf#$8"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox48', group: 'checkboxGroup'}) + .key("ArkUX_Stage_Checkbox_CheckMarkWidth_1200") + .select(true) + .selectedColor(0xed6f21) + .mark({strokeWidth:"40lpx"}) + .width(null) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox49', group: 'checkboxGroup'}) + .key("ArkUX_Stage_Checkbox_CheckMarkWidth_1300") + .select(true) + .selectedColor(0xed6f21) + .unselectedColor(Color.Pink) + .mark({strokeWidth:-1}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox49', group: 'checkboxGroup'}) + .key("ArkUX_Stage_Checkbox_CheckMarkWidth_1400") + .select(true) + .selectedColor(0xed6f21) + .unselectedColor(Color.Pink) + .mark({strokeColor:0x00ff00, size:40, strokeWidth:40}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + } + } + .width('100%') + } + .height('100%') + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestAbility/pages/CheckBoxGroup.ets b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestAbility/pages/CheckBoxGroup.ets new file mode 100644 index 0000000000000000000000000000000000000000..31bd593f5b87c22505a8fc897203a597eafd9ec1 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestAbility/pages/CheckBoxGroup.ets @@ -0,0 +1,566 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + //@ts-nocheck +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import hilog from '@ohos.hilog'; +import testsuite from '../../test/List.test' +@Entry +@Component +struct checkBoxTest { + + aboutToAppear() { + } + + build() { + Row() { + Column() { + List({space: 0, initialIndex: 0 }){ + ListItem(){ + Checkbox({name: 'checkbox1', group: 'checkboxGroup2'}) + .select(true) + .selectedColor(0xed6f21) + .unselectedColor(0x00ff00) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox2', group: 'checkboxGroup2'}) + .select(false) + .selectedColor(0xed6f21) + .unselectedColor("#fffd0000") + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0100") + .selectAll(true) + .selectedColor(0xed6f21) + .mark({strokeColor:0x00ff00}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup2'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0200") + .selectedColor(0xed6f21) + .mark({strokeColor:"#fffd0000"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup3'}) + .selectAll(false) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0300") + .selectedColor(0xed6f21) + .mark({strokeColor:"rgb(138,43,226)"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup4'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0400") + .selectedColor(0xed6f21) + .mark({strokeColor:Color.Pink}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup5'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0500") + .selectedColor(0xed6f21) + .mark({strokeColor:$r("app.color.checkbox_Color")}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup6'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0600") + .selectedColor(0xed6f21) + .mark({strokeColor:""}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup7'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0700") + .selectedColor(0xed6f21) + .mark({strokeColor:null}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup8'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0800") + .selectedColor(0xed6f21) + .mark({strokeColor:undefined}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup9'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0900") + .selectedColor(0xed6f21) + .mark({strokeColor:Color.Pink}) + .mark({strokeColor:"#FFFD0000"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup10'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1000") + .selectedColor(0xed6f21) + .mark({strokeColor:Color.Pink}) + .mark({strokeColor:'bgr(138,43,226)'}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup11'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1100") + .selectedColor(0xed6f21) + .mark({strokeColor:'bgr(138,43,226)'}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup12'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1200") + .selectedColor(0xed6f21) + .mark({strokeColor:0x00ff00}) + .backgroundColor(null) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup12'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1300") + .selectedColor(0xed6f21) + .mark({strokeColor:-1}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup13'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkSize_0100") + .selectedColor(0xed6f21) + .mark({size:0}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup14'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkSize_0200") + .selectedColor(0xed6f21) + .mark({size:10}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup15'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkSize_0300") + .selectedColor(0xed6f21) + .mark({size:"60px"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup16'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkSize_0400") + .selectedColor(0xed6f21) + .mark({size:"120%"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup17'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkSize_0500") + .selectedColor(0xed6f21) + .mark({size:$r("app.string.Check_Mark_Size_test")}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup18'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkSize_0600") + .selectedColor(0xed6f21) + .mark({size:""}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup19'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkSize_0700") + .selectedColor(0xed6f21) + .mark({size:null}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup20'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkSize_0800") + .selectedColor(0xed6f21) + .mark({size:undefined}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup21'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkSize_0900") + .selectedColor(0xed6f21) + .mark({size:10}) + .mark({size:"40fp"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup22'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkSize_1000") + .selectedColor(0xed6f21) + .mark({size:10}) + .mark({size:undefined}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup23'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkSize_1100") + .selectedColor(0xed6f21) + .mark({size:"asdf#$8"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup24'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkSize_1200") + .selectedColor(0xed6f21) + .mark({size:"10.00lpx"}) + .size(null) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup24'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkSize_1300") + .selectedColor(0xed6f21) + .mark({size:-10}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup25'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkWidth_0100") + .selectedColor(0xed6f21) + .mark({strokeWidth:0}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup26'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkWidth_0200") + .selectedColor(0xed6f21) + .mark({strokeWidth:1}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup27'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkWidth_0300") + .selectedColor(0xed6f21) + .mark({strokeWidth:"60px"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup28'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkWidth_0400") + .selectedColor(0xed6f21) + .mark({strokeWidth:"120%"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup29'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkWidth_0500") + .selectedColor(0xed6f21) + .mark({strokeWidth:$r("app.string.Check_Mark_Size_test")}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup30'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkWidth_0600") + .selectedColor(0xed6f21) + .mark({strokeWidth:""}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup31'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkWidth_0700") + .selectedColor(0xed6f21) + .mark({strokeWidth:null}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup32'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkWidth_0800") + .selectedColor(0xed6f21) + .mark({strokeWidth:undefined}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup33'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkWidth_0900") + .selectedColor(0xed6f21) + .mark({strokeWidth:10}) + .mark({strokeWidth:"5fp"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup34'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkWidth_1000") + .selectedColor(0xed6f21) + .mark({strokeWidth:10}) + .mark({strokeWidth:undefined}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup35'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkWidth_1100") + .selectedColor(0xed6f21) + .mark({strokeWidth:"frgw*&^%"}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup36'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkWidth_1200") + .selectedColor(0xed6f21) + .mark({strokeWidth:"40lpx"}) + .width(null) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup37'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkWidth_1300") + .selectedColor(0xed6f21) + .unselectedColor(Color.Pink) + .mark({strokeWidth:-1}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup37'}) + .key("ArkUX_Stage_CheckboxGroup_CheckMarkWidth_1400") + .selectedColor(0xed6f21) + .unselectedColor(Color.Pink) + .mark({strokeColor:0x00ff00, size:40, strokeWidth:40}) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup38'}) + .key("ArkUX_Stage_CheckboxGroup_unselectedColor_0100") + .selectedColor(0xed6f21) + .unselectedColor(0x00ff00) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup39'}) + .key("ArkUX_Stage_CheckboxGroup_unselectedColor_0200") + .selectedColor(0xed6f21) + .unselectedColor('#fffd0000') + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup40'}) + .key("ArkUX_Stage_CheckboxGroup_unselectedColor_0300") + .selectedColor(0xed6f21) + .unselectedColor("rgb(138,43,226)") + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup41'}) + .key("ArkUX_Stage_CheckboxGroup_unselectedColor_0400") + .selectedColor(0xed6f21) + .unselectedColor(Color.Pink) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup42'}) + .key("ArkUX_Stage_CheckboxGroup_unselectedColor_0500") + .selectedColor(0xed6f21) + .unselectedColor($r("app.color.checkbox_Color")) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup43'}) + .key("ArkUX_Stage_CheckboxGroup_unselectedColor_0600") + .selectedColor(0xed6f21) + .unselectedColor("") + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup44'}) + .key("ArkUX_Stage_CheckboxGroup_unselectedColor_0700") + .selectedColor(0xed6f21) + .unselectedColor(null) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup45'}) + .key("ArkUX_Stage_CheckboxGroup_unselectedColor_0800") + .selectedColor(0xed6f21) + .unselectedColor(undefined) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup46'}) + .key("ArkUX_Stage_CheckboxGroup_unselectedColor_0900") + .selectedColor(0xed6f21) + .unselectedColor(Color.Pink) + .unselectedColor("#FFFD0000") + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup47'}) + .key("ArkUX_Stage_CheckboxGroup_unselectedColor_1000") + .selectedColor(0xed6f21) + .unselectedColor(Color.Pink) + .unselectedColor(undefined) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup48'}) + .key("ArkUX_Stage_CheckboxGroup_unselectedColor_1100") + .selectedColor(0xed6f21) + .unselectedColor('bgr(138,43,226)') + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup49'}) + .key("ArkUX_Stage_CheckboxGroup_unselectedColor_1200") + .selectedColor(0xed6f21) + .unselectedColor(0x00ff00) + .backgroundColor(null) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroup49'}) + .key("ArkUX_Stage_CheckboxGroup_unselectedColor_1300") + .selectedColor(0xed6f21) + .unselectedColor(-1) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + CheckboxGroup({group: 'checkboxGroupNO'}) + .key("checkboxGroupNO") + .selectedColor(0xed6f21) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + ListItem(){ + Checkbox({name: 'checkbox3', group: 'checkboxGroupNO'}) + .key("checkboxNO") + .select(true) + .selectedColor(0xed6f21) + .onChange((value: boolean) => { + console.info('Checkbox1 change is'+ value) + }) + } + } + } + .width('100%') + } + .height('100%') + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestAbility/pages/Index.ets b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestAbility/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..f9a8eb77d16179c2eacf7897004d47c2b6a0c482 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestAbility/pages/Index.ets @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import hilog from '@ohos.hilog'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../test/List.test' + +@Entry +@Component +struct Index { + aboutToAppear() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + @State message: string = 'ArkUX XtsTest' + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6c662824093f9339085214d247c6247faa86ae9 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s it', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${targetParams} ${key} ${parameters[key]}` + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/test/List.test.ets b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..340622b55625ec047b152c239931f4e7ae6a2aa4 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/test/List.test.ets @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import checkBoxTest from './checkBox' +import checkBoxGroupTest from './checkBoxGroup' + +export default function testsuite() { + checkBoxTest() + checkBoxGroupTest() +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/test/checkBox.ets b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/test/checkBox.ets new file mode 100644 index 0000000000000000000000000000000000000000..1b94e0bd16b429d8e97df255ebb328a64ade60c0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/test/checkBox.ets @@ -0,0 +1,1597 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// @ts-nocheck +import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' +import router from '@system.router'; +export default function checkBoxTest() { + describe('ActsCheckBoxTest', function () { + + beforeEach(async function (done) { + let options = { + uri: "TestAbility/pages/CheckBox", + } + try { + router.clear(); + let pages = router.getState(); + console.info("get checkBox state success " + JSON.stringify(pages)); + if (!("CheckBox" == pages.name)) { + console.info("get checkBox state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push checkBox page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push checkBox page error " + JSON.stringify(err)); + } + await sleep(2) + done() + }); + + /* + *tc.number ArkUX_Stage_Checkbox_unselectedColor_0100 + *tc.name Tests the unselectedColor property of the Checkbox component + *tc.desc Set the unselectedColor property parameter to 0x00ff00 + */ + it('ArkUX_Stage_Checkbox_unselectedColor_0100', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_unselectedColor_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_unselectedColor_0100'); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0100 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_unselectedColor_0200 + *tc.name Tests the unselectedColor property of the Checkbox component + *tc.desc Set the unselectedColor property parameter to '#fffd0000' + */ + it('ArkUX_Stage_Checkbox_unselectedColor_0200', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_unselectedColor_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_unselectedColor_0200'); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0200 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_unselectedColor_0300 + *tc.name Tests the unselectedColor property of the Checkbox component + *tc.desc Set the unselectedColor property parameter to 'rgb(138,43,226)' + */ + it('ArkUX_Stage_Checkbox_unselectedColor_0300', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_unselectedColor_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_unselectedColor_0300'); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0300 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#FF8A2BE2"); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0300 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0300 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_unselectedColor_0400 + *tc.name Tests the unselectedColor property of the Checkbox component + *tc.desc Set the unselectedColor property parameter to Color.Pink + */ + it('ArkUX_Stage_Checkbox_unselectedColor_0400', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_unselectedColor_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_unselectedColor_0400'); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0400 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#FFFFC0CB"); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0400 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0400 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_unselectedColor_0500 + *tc.name Tests the unselectedColor property of the Checkbox component + *tc.desc Set the unselectedColor property parameter to $r("app.color.checkbox_Color") + */ + it('ArkUX_Stage_Checkbox_unselectedColor_0500', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_unselectedColor_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_unselectedColor_0500'); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0500 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0500 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0500 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_unselectedColor_0600 + *tc.name Tests the unselectedColor property of the Checkbox component + *tc.desc Set the unselectedColor property parameter to an outlier "" + */ + it('ArkUX_Stage_Checkbox_unselectedColor_0600', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_unselectedColor_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_unselectedColor_0600'); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0600 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#66182431"); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0600 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0600 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_unselectedColor_0700 + *tc.name Tests the unselectedColor property of the Checkbox component + *tc.desc Set the unselectedColor property parameter to an outlier null + */ + it('ArkUX_Stage_Checkbox_unselectedColor_0700', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_unselectedColor_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_unselectedColor_0700'); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0700 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#66182431"); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0700 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0700 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_unselectedColor_0800 + *tc.name Tests the unselectedColor property of the Checkbox component + *tc.desc Set the unselectedColor property parameter to an outlier undefined + */ + it('ArkUX_Stage_Checkbox_unselectedColor_0800', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_unselectedColor_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_unselectedColor_0800'); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0800 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#66182431"); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0800 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0800 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_unselectedColor_0900 + *tc.name Tests the unselectedColor property of the Checkbox component + *tc.desc Set the unselectedColor property parameter to Color.Pink + * and again set the unselectedColor property parameter to "#FFFD0000". + */ + it('ArkUX_Stage_Checkbox_unselectedColor_0900', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_unselectedColor_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_unselectedColor_0900'); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0900 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_0900 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0900 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_unselectedColor_0900 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_unselectedColor_1000 + *tc.name Tests the unselectedColor property of the Checkbox component + *tc.desc Set the unselectedColor property parameter to Color.Pink + * and again set the unselectedColor property parameter to the outlier value of undefined + */ + it('ArkUX_Stage_Checkbox_unselectedColor_1000', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_unselectedColor_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_unselectedColor_1000'); + console.info('ArkUX_Stage_Checkbox_unselectedColor_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_unselectedColor_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_1000 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_1000 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#66182431"); + console.info('ArkUX_Stage_Checkbox_unselectedColor_1000 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_unselectedColor_1000 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_unselectedColor_1100 + *tc.name Tests the unselectedColor property of the Checkbox component + *tc.desc Set unselectedColor property parameter to outlier 'bgr(138,43,226)' + */ + it('ArkUX_Stage_Checkbox_unselectedColor_1100', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_unselectedColor_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_unselectedColor_1100'); + console.info('ArkUX_Stage_Checkbox_unselectedColor_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_unselectedColor_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_1100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_1100 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#66182431"); + console.info('ArkUX_Stage_Checkbox_unselectedColor_1100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_unselectedColor_1100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_unselectedColor_1200 + *tc.name Tests the unselectedColor property of the Checkbox component + *tc.desc Set the unselectedColor property parameter to 0x00ff00 + * and the universal property backgroundColor property value to the outlier null + */ + it('ArkUX_Stage_Checkbox_unselectedColor_1200', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_unselectedColor_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_unselectedColor_1200'); + console.info('ArkUX_Stage_Checkbox_unselectedColor_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_unselectedColor_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_1200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_unselectedColor_1200 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_Checkbox_unselectedColor_1200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_unselectedColor_1200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkColor_0100 + *tc.name Tests the CheckMarkColor property of the Checkbox component + *tc.desc Set the checkMarkColor property parameter to 0x00ff00 + */ + it('ArkUX_Stage_Checkbox_CheckMarkColor_0100', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkColor_0100'); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0100 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0100 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0100 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkColor_0200 + *tc.name Tests the CheckMarkColor property of the Checkbox component + *tc.desc Set the checkMarkColor property parameter to '#fffd0000' + */ + it('ArkUX_Stage_Checkbox_CheckMarkColor_0200', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkColor_0200'); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0200 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0200 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0200 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkColor_0300 + *tc.name Tests the CheckMarkColor property of the Checkbox component + *tc.desc Set the checkMarkColor property parameter to 'rgb(138,43,226)' + */ + it('ArkUX_Stage_Checkbox_CheckMarkColor_0300', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkColor_0300'); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0300 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0300 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0300 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FF8A2BE2"); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0300 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0300 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkColor_0400 + *tc.name Tests the CheckMarkColor property of the Checkbox component + *tc.desc Set the checkMarkColor property parameter to Color.Pink + */ + it('ArkUX_Stage_Checkbox_CheckMarkColor_0400', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkColor_0400'); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0400 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0400 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0400 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFFC0CB"); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0400 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0400 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkColor_0500 + *tc.name Tests the CheckMarkColor property of the Checkbox component + *tc.desc Set the checkMarkColor property parameter to $r("app.color.checkbox_Color") + */ + it('ArkUX_Stage_Checkbox_CheckMarkColor_0500', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkColor_0500'); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0500 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0500 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0500 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0500 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0500 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkColor_0600 + *tc.name Tests the CheckMarkColor property of the Checkbox component + *tc.desc Set the checkMarkColor property parameter to an outlier "" + */ + it('ArkUX_Stage_Checkbox_CheckMarkColor_0600', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkColor_0600'); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0600 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0600 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0600 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0600 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0600 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkColor_0700 + *tc.name Tests the CheckMarkColor property of the Checkbox component + *tc.desc Set the checkMarkColor property parameter to an outlier null + */ + it('ArkUX_Stage_Checkbox_CheckMarkColor_0700', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkColor_0700'); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0700 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0700 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0700 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0700 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0700 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkColor_0800 + *tc.name Tests the CheckMarkColor property of the Checkbox component + *tc.desc Set the checkMarkColor property parameter to an outlier undefined + */ + it('ArkUX_Stage_Checkbox_CheckMarkColor_0800', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkColor_0800'); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0800 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0800 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0800 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0800 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0800 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkColor_0900 + *tc.name Tests the CheckMarkColor property of the Checkbox component + *tc.desc Set the checkMarkColor property parameter to Color.Pink + * and again set the checkMarkColor property parameter to "#FFFD0000". + */ + it('ArkUX_Stage_Checkbox_CheckMarkColor_0900', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkColor_0900'); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0900 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0900 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0900 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_0900 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0900 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_0900 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkColor_1000 + *tc.name Tests the CheckMarkColor property of the Checkbox component + *tc.desc Set the checkMarkColor property parameter to Color.Pink + * and again set the checkMarkColor property parameter to the outlier 'bgr(138,43,226)'. + */ + it('ArkUX_Stage_Checkbox_CheckMarkColor_1000', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkColor_1000'); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_1000 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_1000 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_1000 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_1000 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_1000 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_1000 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkColor_1100 + *tc.name Tests the CheckMarkColor property of the Checkbox component + *tc.desc Set checkMarkColor property parameter to outlier 'bgr(138,43,226)' + */ + it('ArkUX_Stage_Checkbox_CheckMarkColor_1100', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkColor_1100'); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_1100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_1100 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_1100 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_1100 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_1100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_1100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkColor_1200 + *tc.name Tests the CheckMarkColor property of the Checkbox component + *tc.desc Set the checkMarkColor property parameter to 0x00ff00 + * and the universal property backgroundColor property value to null outlier + */ + it('ArkUX_Stage_Checkbox_CheckMarkColor_1200', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkColor_1200'); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_1200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_1200 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_1200 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkColor_1200 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_1200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkColor_1200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkSize_0100 + *tc.name Tests the CheckMarkSize property of the Checkbox component + *tc.desc Set the checkMarkSize property parameter to 0 + */ + it('ArkUX_Stage_Checkbox_CheckMarkSize_0100', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkSize_0100'); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0100 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0100 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0100 component markObj.size is: " + + JSON.stringify(markObj.size)); + expect(markObj.size).assertEqual("0.00vp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkSize_0200 + *tc.name Tests the CheckMarkSize property of the Checkbox component + *tc.desc Set the checkMarkSize property parameter to 1 + */ + it('ArkUX_Stage_Checkbox_CheckMarkSize_0200', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkSize_0200'); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0200 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0200 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0200 component markObj.size is: " + + JSON.stringify(markObj.size)); + expect(markObj.size).assertEqual("1.00vp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkSize_0300 + *tc.name Tests the CheckMarkSize property of the Checkbox component + *tc.desc Set the checkMarkSize property to string "60px". + */ + it('ArkUX_Stage_Checkbox_CheckMarkSize_0300', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkSize_0300'); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0300 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0300 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0300 component markObj.size is: " + + JSON.stringify(markObj.size)); + expect(markObj.size).assertEqual("60.00px"); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0300 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0300 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkSize_0400 + *tc.name Tests the CheckMarkSize property of the Checkbox component + *tc.desc Set the checkMarkSize property parameter to the percentage string "120%". + */ + it('ArkUX_Stage_Checkbox_CheckMarkSize_0400', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkSize_0400'); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0400 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0400 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0400 component markObj.size is: " + + JSON.stringify(markObj.size)); + expect(markObj.size).assertEqual("-1.00px"); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0400 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0400 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkSize_0500 + *tc.name Tests the CheckMarkSize property of the Checkbox component + *tc.desc Set the checkMarkSize property parameter to + * the resource reference type $r("app.string.Check_Mark_Size_test") + */ + it('ArkUX_Stage_Checkbox_CheckMarkSize_0500', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkSize_0500'); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0500 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0500 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0500 component markObj.size is: " + + JSON.stringify(markObj.size)); + expect(markObj.size).assertEqual("50.00vp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0500 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0500 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkSize_0600 + *tc.name Tests the CheckMarkSize property of the Checkbox component + *tc.desc Set the checkMarkSize property parameter to an outlier "" + */ + it('ArkUX_Stage_Checkbox_CheckMarkSize_0600', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkSize_0600'); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0600 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0600 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0600 component markObj.size is: " + + JSON.stringify(markObj.size)); + expect(markObj.size).assertEqual("0.00vp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0600 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0600 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkSize_0700 + *tc.name Tests the CheckMarkSize property of the Checkbox component + *tc.desc Set the checkMarkSize property parameter to an outlier null + */ + it('ArkUX_Stage_Checkbox_CheckMarkSize_0700', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkSize_0700'); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0700 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0700 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0700 component markObj.size is: " + + JSON.stringify(markObj.size)); + expect(markObj.size).assertEqual("-1.00px"); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0700 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0700 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkSize_0800 + *tc.name Tests the CheckMarkSize property of the Checkbox component + *tc.desc Set the checkMarkSize property parameter to an outlier undefined + */ + it('ArkUX_Stage_Checkbox_CheckMarkSize_0800', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkSize_0800'); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0800 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0800 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0800 component markObj.size is: " + + JSON.stringify(markObj.size)); + expect(markObj.size).assertEqual("-1.00px"); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0800 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0800 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkSize_0900 + *tc.name Tests the CheckMarkSize property of the Checkbox component + *tc.desc Set the checkMarkSize property parameter to 10 + * and again set the checkMarkSize property parameter to 40 + */ + it('ArkUX_Stage_Checkbox_CheckMarkSize_0900', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkSize_0900'); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0900 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0900 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0900 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_0900 component markObj.size is: " + + JSON.stringify(markObj.size)); + expect(markObj.size).assertEqual("40.00fp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0900 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_0900 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkSize_1000 + *tc.name Tests the CheckMarkSize property of the Checkbox component + *tc.desc Set the checkMarkSize property parameter to 10 + * and again set the checkMarkSize property parameter to the exception value undefined + */ + it('ArkUX_Stage_Checkbox_CheckMarkSize_1000', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkSize_1000'); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1000 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1000 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1000 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1000 component markObj.size is: " + + JSON.stringify(markObj.size)); + expect(markObj.size).assertEqual("-1.00px"); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1000 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1000 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkSize_1100 + *tc.name Tests the CheckMarkSize property of the Checkbox component + *tc.desc Set the checkMarkSize property parameter to the outlier "asdf#$8". + */ + it('ArkUX_Stage_Checkbox_CheckMarkSize_1100', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkSize_1100'); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1100 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1100 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1100 component markObj.size is: " + + JSON.stringify(markObj.size)); + expect(markObj.size).assertEqual("0.00vp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkSize_1200 + *tc.name Tests the CheckMarkSize property of the Checkbox component + *tc.desc Set the checkMarkSize property parameter to 10lpx and the generic size property value to null + */ + it('ArkUX_Stage_Checkbox_CheckMarkSize_1200', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkSize_1200'); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1200 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1200 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1200 component markObj.strokeWidth is: " + + JSON.stringify(markObj.size)); + expect(markObj.size).assertEqual("10.00lpx"); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkSize_1300 + *tc.name Tests the CheckMarkSize property of the Checkbox component + *tc.desc Set the checkMarkSize property parameter to an outlier -10 + */ + it('ArkUX_Stage_Checkbox_CheckMarkSize_1300', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkSize_1300'); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1300 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1300 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkSize_1300 component markObj.size is: " + + JSON.stringify(markObj.size)); + expect(markObj.size).assertEqual("-1.00px"); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1300 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkSize_1300 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkWidth_0100 + *tc.name Tests the CheckMarkWidth property of the Checkbox component + *tc.desc Set the checkMarkWidth property parameter to 0 + */ + it('ArkUX_Stage_Checkbox_CheckMarkWidth_0100', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkWidth_0100'); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0100 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0100 component markObj is: " + + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0100 component markObj.strokeWidth is: " + + JSON.stringify(markObj.strokeWidth)); + expect(markObj.strokeWidth).assertEqual("0.00vp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkWidth_0200 + *tc.name Tests the CheckMarkWidth property of the Checkbox component + *tc.desc Set the checkMarkWidth property parameter to 1 + */ + it('ArkUX_Stage_Checkbox_CheckMarkWidth_0200', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkWidth_0200'); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0200 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0200 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0200 component markObj.strokeWidth is: " + + JSON.stringify(markObj.strokeWidth)); + expect(markObj.strokeWidth).assertEqual("1.00vp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkWidth_0300 + *tc.name Tests the CheckMarkWidth property of the Checkbox component + *tc.desc Set the checkMarkWidth property to string "60px". + */ + it('ArkUX_Stage_Checkbox_CheckMarkWidth_0300', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkWidth_0300'); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0300 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0300 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0300 component markObj.strokeWidth is: " + + JSON.stringify(markObj.strokeWidth)); + expect(markObj.strokeWidth).assertEqual("60.00px"); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0300 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0300 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkWidth_0400 + *tc.name Tests the CheckMarkWidth property of the Checkbox component + *tc.desc Set the checkMarkWidth property argument to the percentage string "120%". + */ + it('ArkUX_Stage_Checkbox_CheckMarkWidth_0400', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkWidth_0400'); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0400 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0400 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0400 component markObj.strokeWidth is: " + + JSON.stringify(markObj.strokeWidth)); + expect(markObj.strokeWidth).assertEqual("2.00vp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0400 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0400 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkWidth_0500 + *tc.name Tests the CheckMarkWidth property of the Checkbox component + *tc.desc Set the checkMarkWidth property parameter to + * the resource reference type $r("app.string.Check_Mark_Size_test"). + */ + it('ArkUX_Stage_Checkbox_CheckMarkWidth_0500', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkWidth_0500'); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0500 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0500 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0500 component markObj.strokeWidth is: " + + JSON.stringify(markObj.strokeWidth)); + expect(markObj.strokeWidth).assertEqual("50.00vp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0500 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0500 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkWidth_0600 + *tc.name Tests the CheckMarkWidth property of the Checkbox component + *tc.desc Set the checkMarkWidth property parameter to an outlier "" + */ + it('ArkUX_Stage_Checkbox_CheckMarkWidth_0600', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkWidth_0600'); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0600 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0600 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0600 component markObj.strokeWidth is: " + + JSON.stringify(markObj.strokeWidth)); + expect(markObj.strokeWidth).assertEqual("0.00vp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0600 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0600 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkWidth_0700 + *tc.name Tests the CheckMarkWidth property of the Checkbox component + *tc.desc Set the checkMarkWidth property parameter to an outlier null + */ + it('ArkUX_Stage_Checkbox_CheckMarkWidth_0700', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkWidth_0700'); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0700 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0700 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0700 component markObj.strokeWidth is: " + + JSON.stringify(markObj.strokeWidth)); + expect(markObj.strokeWidth).assertEqual("2.00vp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0700 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0700 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkWidth_0800 + *tc.name Tests the CheckMarkWidth property of the Checkbox component + *tc.desc Set the checkMarkWidth property parameter to an outlier undefined + */ + it('ArkUX_Stage_Checkbox_CheckMarkWidth_0800', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkWidth_0800'); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0800 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0800 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0800 component markObj.strokeWidth is: " + + JSON.stringify(markObj.strokeWidth)); + expect(markObj.strokeWidth).assertEqual("2.00vp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0800 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0800 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkWidth_0900 + *tc.name Tests the CheckMarkWidth property of the Checkbox component + *tc.desc Set the checkMarkWidth property parameter to 10 and the checkMarkWidth property parameter to 5fp again + */ + it('ArkUX_Stage_Checkbox_CheckMarkWidth_0900', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkWidth_0900'); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0900 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0900 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0900 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0900 component markObj.strokeWidth is: " + + JSON.stringify(markObj.strokeWidth)); + expect(markObj.strokeWidth).assertEqual("5.00fp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0900 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_0900 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkWidth_1000 + *tc.name Tests the CheckMarkWidth property of the Checkbox component + *tc.desc Set the checkMarkWidth property parameter to 10 + * and again set the checkMarkWidth property parameter to the exception value undefined + */ + it('ArkUX_Stage_Checkbox_CheckMarkWidth_1000', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkWidth_1000'); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1000 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1000 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1000 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1000 component markObj.strokeWidth is: " + + JSON.stringify(markObj.strokeWidth)); + expect(markObj.strokeWidth).assertEqual("2.00vp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1000 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1000 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkWidth_1100 + *tc.name Tests the CheckMarkWidth property of the Checkbox component + *tc.desc Set the checkMarkWidth property parameter to an exception value of "asdf#$8". + */ + it('ArkUX_Stage_Checkbox_CheckMarkWidth_1100', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkWidth_1100'); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1100 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1100 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1100 component markObj.strokeWidth is: " + + JSON.stringify(markObj.strokeWidth)); + expect(markObj.strokeWidth).assertEqual("0.00vp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkWidth_1200 + *tc.name Tests the CheckMarkWidth property of the Checkbox component + *tc.desc Set the checkMarkWidth property parameter to "40lpx" and the common property width property value to null + */ + it('ArkUX_Stage_Checkbox_CheckMarkWidth_1200', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkWidth_1200'); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1200 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0100 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_0100 component markObj.strokeWidth is: " + + JSON.stringify(markObj.strokeWidth)); + expect(markObj.strokeWidth).assertEqual("40.00lpx"); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkWidth_1300 + *tc.name Tests the CheckMarkWidth property of the Checkbox component + *tc.desc Set the checkMarkWidth property parameter to an exception value of -1. + */ + it('ArkUX_Stage_Checkbox_CheckMarkWidth_1300', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkWidth_1300'); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1300 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1300 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1300 component markObj.strokeWidth is: " + + JSON.stringify(markObj.strokeWidth)); + expect(markObj.strokeWidth).assertEqual("2.00vp"); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1300 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1300 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_Checkbox_CheckMarkWidth_1400 + *tc.name Tests the CheckMarkWidth&checkMarkSize&checkMarkColor&unselectedColor property + of the Checkbox component + *tc.desc Simultaneous setting checkMarkWidth(40) checkMarkSize(40) + * checkMarkColor(0x00ff00) unselectedColor(Color.Pink) + */ + it('ArkUX_Stage_Checkbox_CheckMarkWidth_1400', 0, async function (done) { + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Checkbox_CheckMarkWidth_1400'); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1400 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1400 component markObj is: " + JSON.stringify(markObj)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1400 component markObj.strokeWidth is: " + + JSON.stringify(markObj.strokeWidth)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1400 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1400 component markObj.strokeWidth is: " + + JSON.stringify(markObj.strokeWidth)); + console.info("ArkUX_Stage_Checkbox_CheckMarkWidth_1400 component markObj.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(markObj.strokeWidth).assertEqual("40.00vp"); + expect(markObj.size).assertEqual("40.00vp"); + expect(markObj.strokeColor).assertEqual("#FF00FF00"); + expect(obj.$attrs.unselectedColor).assertEqual("#FFFFC0CB"); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1400 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Checkbox_CheckMarkWidth_1400 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + }) +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/test/checkBoxGroup.ets b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/test/checkBoxGroup.ets new file mode 100644 index 0000000000000000000000000000000000000000..a524fcde521345756869f10eeb7ea99df03fb5d5 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/test/checkBoxGroup.ets @@ -0,0 +1,755 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// @ts-nocheck +import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' +import router from '@system.router'; +export default function checkBoxGroupTest() { + describe('ActsCheckBoxGroupTest', function () { + + beforeEach(async function (done) { + let options = { + uri: "TestAbility/pages/CheckBoxGroup", + } + try { + router.clear(); + let pages = router.getState(); + console.info("get CheckBoxGroup state success " + JSON.stringify(pages)); + if (!("CheckBoxGroup" == pages.name)) { + console.info("get CheckBoxGroup state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push CheckBoxGroup page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push CheckBoxGroup page error " + JSON.stringify(err)); + } + await sleep(2) + done() + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_unselectedColor_0100 + *tc.name Tests the unselectedColor property of the CheckboxGroup component + *tc.desc Set the unselectedColor property parameter to 0x00ff00 + */ + it('ArkUX_Stage_CheckboxGroup_unselectedColor_0100', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_unselectedColor_0100'); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0100 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_unselectedColor_0200 + *tc.name Tests the unselectedColor property of the CheckboxGroup component + *tc.desc Set the unselectedColor property parameter to '#fffd0000' + */ + it('ArkUX_Stage_CheckboxGroup_unselectedColor_0200', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_unselectedColor_0200'); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0200 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_unselectedColor_0300 + *tc.name Tests the unselectedColor property of the CheckboxGroup component + *tc.desc Set the unselectedColor property parameter to 'rgb(138,43,226)' + */ + it('ArkUX_Stage_CheckboxGroup_unselectedColor_0300', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_unselectedColor_0300'); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0300 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#FF8A2BE2"); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0300 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0300 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_unselectedColor_0400 + *tc.name Tests the unselectedColor property of the CheckboxGroup component + *tc.desc Set the unselectedColor property parameter to Color.Pink + */ + it('ArkUX_Stage_CheckboxGroup_unselectedColor_0400', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_unselectedColor_0400'); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0400 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#FFFFC0CB"); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0400 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0400 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_unselectedColor_0500 + *tc.name Tests the unselectedColor property of the CheckboxGroup component + *tc.desc Set the unselectedColor property parameter to $r("app.color.checkbox_Color") + */ + it('ArkUX_Stage_CheckboxGroup_unselectedColor_0500', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_unselectedColor_0500'); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0500 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0500 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0500 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_unselectedColor_0600 + *tc.name Tests the unselectedColor property of the CheckboxGroup component + *tc.desc Set the unselectedColor property parameter to an outlier "" + */ + it('ArkUX_Stage_CheckboxGroup_unselectedColor_0600', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_unselectedColor_0600'); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0600 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#66182431"); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0600 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0600 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_unselectedColor_0700 + *tc.name Tests the unselectedColor property of the CheckboxGroup component + *tc.desc Set the unselectedColor property parameter to an outlier null + */ + it('ArkUX_Stage_CheckboxGroup_unselectedColor_0700', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_unselectedColor_0700'); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0700 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#66182431"); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0700 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0700 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_unselectedColor_0800 + *tc.name Tests the unselectedColor property of the CheckboxGroup component + *tc.desc Set the unselectedColor property parameter to an outlier undefined + */ + it('ArkUX_Stage_CheckboxGroup_unselectedColor_0800', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_unselectedColor_0800'); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0800 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#66182431"); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0800 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0800 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_unselectedColor_0900 + *tc.name Tests the unselectedColor property of the CheckboxGroup component + *tc.desc Set the unselectedColor property parameter to Color.Pink + * and again set the unselectedColor property parameter to "#FFFD0000". + */ + it('ArkUX_Stage_CheckboxGroup_unselectedColor_0900', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_unselectedColor_0900'); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0900 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_0900 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0900 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_0900 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_unselectedColor_1000 + *tc.name Tests the unselectedColor property of the CheckboxGroup component + *tc.desc Set the unselectedColor property parameter to Color.Pink + * and again set the unselectedColor property parameter to the outlier value of undefined + */ + it('ArkUX_Stage_CheckboxGroup_unselectedColor_1000', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_unselectedColor_1000'); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_1000 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_1000 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#66182431"); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_1000 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_1000 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_unselectedColor_1100 + *tc.name Tests the unselectedColor property of the CheckboxGroup component + *tc.desc Set unselectedColor property parameter to outlier 'bgr(138,43,226)' + */ + it('ArkUX_Stage_CheckboxGroup_unselectedColor_1100', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_unselectedColor_1100'); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_1100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_1100 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#66182431"); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_1100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_1100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_unselectedColor_1200 + *tc.name Tests the unselectedColor property of the CheckboxGroup component + *tc.desc Set the unselectedColor property parameter to 0x00ff00 + * and the universal property backgroundColor property value to the outlier null + */ + it('ArkUX_Stage_CheckboxGroup_unselectedColor_1200', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_unselectedColor_1200'); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_1200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_unselectedColor_1200 component obj.$attrs.unselectedColor is: " + + JSON.stringify(obj.$attrs.unselectedColor)); + expect(obj.$attrs.unselectedColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_1200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_unselectedColor_1200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_CheckMarkColor_0100 + *tc.name Tests the CheckMarkColor property of the CheckboxGroup component + *tc.desc Set the checkMarkColor property parameter to 0x00ff00 + */ + it('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0100', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0100'); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0100 component obj.$attrs.mark is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0100 component markObj is: " + + JSON.stringify(markObj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0100 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_CheckMarkColor_0200 + *tc.name Tests the CheckMarkColor property of the CheckboxGroup component + *tc.desc Set the checkMarkColor property parameter to '#fffd0000' + */ + it('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0200', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0200'); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0200 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0200 component markObj is: " + + JSON.stringify(markObj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0200 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_CheckMarkColor_0300 + *tc.name Tests the CheckMarkColor property of the CheckboxGroup component + *tc.desc Set the checkMarkColor property parameter to 'rgb(138,43,226)' + */ + it('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0300', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0300'); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0300 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0300 component markObj is: " + + JSON.stringify(markObj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0300 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FF8A2BE2"); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0300 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0300 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_CheckMarkColor_0400 + *tc.name Tests the CheckMarkColor property of the CheckboxGroup component + *tc.desc Set the checkMarkColor property parameter to Color.Pink + */ + it('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0400', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0400'); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0400 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0400 component markObj is: " + + JSON.stringify(markObj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0400 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFFC0CB"); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0400 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0400 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_CheckMarkColor_0500 + *tc.name Tests the CheckMarkColor property of the CheckboxGroup component + *tc.desc Set the checkMarkColor property parameter to $r("app.color.checkbox_Color") + */ + it('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0500', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0500'); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0500 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0500 component markObj is: " + + JSON.stringify(markObj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0500 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0500 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0500 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_CheckMarkColor_0600 + *tc.name Tests the CheckMarkColor property of the CheckboxGroup component + *tc.desc Set the checkMarkColor property parameter to an outlier "" + */ + it('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0600', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0600'); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0600 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0600 component markObj is: " + + JSON.stringify(markObj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0600 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0600 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0600 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_CheckMarkColor_0700 + *tc.name Tests the CheckMarkColor property of the CheckboxGroup component + *tc.desc Set the checkMarkColor property parameter to an outlier null + */ + it('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0700', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0700'); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0700 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0700 component markObj is: " + + JSON.stringify(markObj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0700 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0700 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0700 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_CheckMarkColor_0800 + *tc.name Tests the CheckMarkColor property of the CheckboxGroup component + *tc.desc Set the checkMarkColor property parameter to an outlier undefined + */ + it('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0800', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0800'); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0800 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0800 component markObj is: " + + JSON.stringify(markObj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0800 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0800 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0800 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_CheckMarkColor_0900 + *tc.name Tests the CheckMarkColor property of the CheckboxGroup component + *tc.desc Set the checkMarkColor property parameter to Color.Pink + * and again set the checkMarkColor property parameter to "#FFFD0000". + */ + it('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0900', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0900'); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0900 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0900 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0900 component markObj is: " + + JSON.stringify(markObj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_0900 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0900 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_0900 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_CheckMarkColor_1000 + *tc.name Tests the CheckMarkColor property of the CheckboxGroup component + *tc.desc Set the checkMarkColor property parameter to Color.Pink + * and again set the checkMarkColor property parameter to the outlier 'bgr(138,43,226)'. + */ + it('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1000', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1000'); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1000 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1000 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1000 component markObj is: " + + JSON.stringify(markObj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1000 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1000 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1000 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_CheckMarkColor_1100 + *tc.name Tests the CheckMarkColor property of the CheckboxGroup component + *tc.desc Set checkMarkColor property parameter to outlier 'bgr(138,43,226)' + */ + it('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1100', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1100'); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1100 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1100 component markObj is: " + + JSON.stringify(markObj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1100 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_CheckboxGroup_CheckMarkColor_1200 + *tc.name Tests the CheckMarkColor property of the CheckboxGroup component + *tc.desc Set the checkMarkColor property parameter to 0x00ff00 + * and the universal property backgroundColor property value to null outlier + */ + it('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1200', 0, async function (done) { + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1200'); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1200 component obj.$attrs.strokeColor is: " + + JSON.stringify(obj.$attrs.mark)); + let markObj = JSON.parse(obj.$attrs.mark); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1200 component markObj is: " + + JSON.stringify(markObj)); + console.info("ArkUX_Stage_CheckboxGroup_CheckMarkColor_1200 component markObj.strokeColor is: " + + JSON.stringify(markObj.strokeColor)); + expect(markObj.strokeColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_CheckboxGroup_CheckMarkColor_1200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + }) +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/module.json b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..2b03fde2a1898cf911b3b3f2f94a553bca8ebb86 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/module.json @@ -0,0 +1,41 @@ +{ + "module": { + "name": "phone", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "visible": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/resources/base/element/color.json b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..33b5a05bcb3fa146ae58af80e572c8a34718fadf --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/resources/base/element/color.json @@ -0,0 +1,16 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "Divider_color", + "value": "#000000" + }, + { + "name": "checkbox_Color", + "value": "#FFFD0000" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f9a034064cc527b3c81e2da6e66b1d0bde87be5a --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + }, + { + "name": "Divider_width", + "value": "10px" + }, + { + "name": "Divider_startMargin", + "value": "5px" + }, + { + "name": "Divider_endMargin", + "value": "5px" + }, + { + "name": "Check_Mark_Size_test", + "value": "50vp" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/resources/base/media/icon.png b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/resources/base/media/icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/resources/base/profile/test_pages.json b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/resources/base/profile/test_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..6bdf20bbd1d77dd91644ecdb41589322892f117a --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/resources/base/profile/test_pages.json @@ -0,0 +1,7 @@ +{ + "src": [ + "TestAbility/pages/Index", + "TestAbility/pages/CheckBox", + "TestAbility/pages/CheckBoxGroup" + ] +} diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/AppScope/app.json b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/AppScope/app.json old mode 100755 new mode 100644 similarity index 56% rename from ability/ability_runtime/non_concurrent/actsthirdappatest/AppScope/app.json rename to arkui/ace_ets_components_ux/ace_ets_component_datapanel/AppScope/app.json index abbd9955c832c1806c83c5eb2b17271f5977bcc9..2e981cba0d049cec7da2ce2c794f86eda5c0691f --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/AppScope/app.json +++ b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/AppScope/app.json @@ -1,19 +1,19 @@ { "app": { - "bundleName": "com.example.actsabilitypermissionthirdtest", + "bundleName": "com.example.datapaneltest", "vendor": "example", "versionCode": 1000000, "versionName": "1.0.0", "icon": "$media:app_icon", "label": "$string:app_name", "distributedNotificationEnabled": true, - "keepAlive" : true, + "keepAlive": true, "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, + "minAPIVersion": 10, + "targetAPIVersion": 10, "car": { - "apiCompatibleVersion": 9, + "apiCompatibleVersion": 10, "singleUser": false - } - } - } \ No newline at end of file + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/AppScope/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 59% rename from ability/ability_runtime/non_concurrent/actsthirdappatest/AppScope/resources/base/element/string.json rename to arkui/ace_ets_components_ux/ace_ets_component_datapanel/AppScope/resources/base/element/string.json index 0d3507c0d180557b94bc5f0071ba146b4909fe51..3e8dda342484af625ea003b67a3db2d55bedcab9 --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/AppScope/resources/base/element/string.json +++ b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/AppScope/resources/base/element/string.json @@ -2,7 +2,7 @@ "string": [ { "name": "app_name", - "value": "ohosProject" + "value": "MyApplication" } ] -} +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/AppScope/resources/base/media/app_icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/BUILD.gn b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..852d94aa39f3f0cf7cf4a81139ea13b36db261d1 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/BUILD.gn @@ -0,0 +1,43 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAceDatapanelTest") { + hap_profile = "src/main/module.json" + js_build_mode = "debug" + deps = [ + ":ace_ets_component_datapanel_js_assets", + ":ace_ets_component_datapanel_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsAceDatapanelTest" + part_name = "ace_engine" + subsystem_name = "arkui" +} + +ohos_app_scope("ace_ets_component_datapanel_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("ace_ets_component_datapanel_js_assets") { + source_dir = "src/main/ets" +} + +ohos_resources("ace_ets_component_datapanel_resources") { + sources = [ "src/main/resources" ] + deps = [ ":ace_ets_component_datapanel_profile" ] + hap_profile = "src/main/module.json" +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/Test.json b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..14f86c9b63ca0513c07abc221092e648d49e510f --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/Test.json @@ -0,0 +1,27 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "600000", + "bundle-name": "com.example.datapaneltest", + "module-name": "phone", + "shell-timeout": "600000", + "testcase-timeout": 240000 + }, + "kits": [ + { + "test-file-name": [ + "ActsAceDatapanelTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "power-shell wakeup", + "power-shell setmode 602" + ] + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/signature/openharmony_sx.p7b b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..71b7f0039c0a08f7d436e84373596b091b441205 Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/signature/openharmony_sx.p7b differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/TestAbility/TestAbility.ets b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/TestAbility/TestAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d65dd2ea8346a8b5d12ac7aff026197a95abaea --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/TestAbility/TestAbility.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import Ability from '@ohos.app.ability.UIAbility' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import testsuite from '../test/List.test' +import Window from '@ohos.window' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('TestAbility/pages/Index', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/TestAbility/pages/Index.ets b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/TestAbility/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..2f1e2a30c74e76be497328d4824618e8e9ec7505 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/TestAbility/pages/Index.ets @@ -0,0 +1,716 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + //@ts-nocheck +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import hilog from '@ohos.hilog'; +import testsuite from '../../test/List.test' +@Entry +@Component +struct DatapanelTest { + + aboutToAppear(){ + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + public color1: Color[] = ["#FFFF0000", "#FF00FF00", "#FF0000FF", "#FF000000"]; + public color2: Color[] = ['rgb(255,0,0)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(0,0,0)'] + public color3: Color[] = [Color.Red, Color.Green, Color.Blue, Color.Black] + public color4: Color[] = ["#FFFF0000", "#FF00FF00", "#FF0000FF", "#FF000000"] + public color5: Color[] = ["#FF000000", "#FFFF0000", "#FF00FF00"] + public color6: LinearGradient = new LinearGradient([{ color: "#FFA500", offset: 0 }, { + color: "#FFFFFF00", offset: 1 }]) + public color7: LinearGradient = new LinearGradient([{ color: "#FFC0CB", offset: 0 }, { + color: "#FF00FF00", offset: 1 }]) + public color8: LinearGradient = new LinearGradient([{ color: "#FF0000FF", offset: 0 }, { + color: "#FFFF0000", offset: 1 }]) + public color9: LinearGradient = new LinearGradient([{ color: 'rgb(255,165,0)', offset: 0 }, { + color: 'rgb(255,255,0)', offset: 1 }]) + public color10: LinearGradient = new LinearGradient([{ color: 'rgb(255,192,203)', offset: 0 }, { + color: 'rgb(0,128,0)', offset: 1 }]) + public color11: LinearGradient = new LinearGradient([{ color: 'rgb(0,0,255)', offset: 0 }, { + color: 'rgb(255,0,0)', offset: 1 }]) + public color12: LinearGradient = new LinearGradient([{ color: Color.Orange, offset: 0 }, { + color: Color.Yellow, offset: 1 }]) + public color13: LinearGradient = new LinearGradient([{ color: Color.Pink, offset: 0 }, { + color: Color.Green, offset: 1 }]) + public color14: LinearGradient = new LinearGradient([{ color: Color.Blue, offset: 0 }, { + color: Color.Red, offset: 1 }]) + public color15: Color[] = ["#01FFA500", "#4CFFFF00", "#9AFFC0CB", "#FF00FF00"] + public color16: Color[] = ['rgba(255,165,0,0)', 'rgba(255,255,0,0)', 'rgba(255,192,203,0)', 'rgba(0,128,0,0)'] + public color17: Color[] = [Color.Orange, Color.Yellow, Color.Pink, Color.Green] + public color18: Color[] = ["#01FFA500", "#4C800080", "#9AFFFF00", "#FF00FF00"] + public color19: LinearGradient = new LinearGradient([{ color: "#01FFA500", offset: 0 }, { + color: "#01FFFF00", offset: 1 }]) + public color39: LinearGradient = new LinearGradient([{ color: "#01FFC0CB", offset: 0 }, { + color: "#0100FF00", offset: 1 }]) + public color20: Color[] = ["#FFFF0000", "#FFFFFF00", "#FF00FF00"] + public color21: Color[] = ['rgb(255,0,0)', 'rgb(255,255,0)', 'rgb(0,255,0)'] + public color22: Color[] = [Color.Red, Color.Yellow, Color.Green] + public color23: LinearGradient = new LinearGradient([{ color: "#FFA500", offset: 0 }, { + color: "#FFFFFF00", offset: 1 }]) + public color24: LinearGradient = new LinearGradient([{ color: "#FFC0CB", offset: 0 }, { + color: "#FF00FF00", offset: 1 }]) + public color25: LinearGradient = new LinearGradient([{ color: "#FF0000FF", offset: 0 }, { + color: "#FFFF0000", offset: 1 }]) + public color26: LinearGradient = new LinearGradient([{ color: 'rgb(255,165,0)', offset: 0 }, { + color: 'rgb(255,255,0)', offset: 1 }]) + public color27: LinearGradient = new LinearGradient([{ color: 'rgb(255,192,203)', offset: 0 }, { + color: 'rgb(0,128,0)', offset: 1 }]) + public color28: LinearGradient = new LinearGradient([{ color: 'rgb(0,0,255)', offset: 0 }, { + color: 'rgb(255,0,0)', offset: 1 }]) + public color29: LinearGradient = new LinearGradient([{ color: Color.Orange, offset: 0 }, { + color: Color.Yellow, offset: 1 }]) + public color30: LinearGradient = new LinearGradient([{ color: Color.Pink, offset: 0 }, { + color: Color.Green, offset: 1 }]) + public color31: LinearGradient = new LinearGradient([{ color: Color.Blue, offset: 0 }, { + color: Color.Red, offset: 1 }]) + public color32: Color = "#FF0000FF" + public color33: LinearGradient = new LinearGradient([{ color: "#FFA500", offset: 0 }, { + color: "#FFC0CB", offset: 1 }]) + public color34: Color = 'rgb(255,0,0)' + public color35: LinearGradient = new LinearGradient([{ color: 'rgb(255,165,0)', offset: 0 }, { + color: 'rgb(255,192,203)', offset: 1 }]) + public color36: Color = Color.Red + public color37: LinearGradient = new LinearGradient([{ color: Color.Orange, offset: 0 }, { + color: Color.Pink, offset: 1 }]) + public colorArray1: Array = [ "#FF0000FF", this.color33 ] + public colorArray2: Array = [ 'rgb(255,0,0)', this.color35 ] + public colorArray3: Array = [ Color.Red, this.color35 ] + public colorArray4: Array = [ $r("app.color.DataPanel_TrackBackgroundColor")] + + build() { + Row() { + Column() { + List({ space: 0, initialIndex: 0 }) { + ListItem() { + DataPanel({ values: [20, 10, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(this.color1) + .key("ArkUX_Stage_DataPanel_ValueColors_0100") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(this.color2) + .key("ArkUX_Stage_DataPanel_ValueColors_0200") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(this.color3) + .key("ArkUX_Stage_DataPanel_ValueColors_0300") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors([$r("app.color.DataPanel_ValueColors1"), $r("app.color.DataPanel_ValueColors2"), + $r("app.color.DataPanel_ValueColors3"), $r("app.color.DataPanel_ValueColors4")]) + .key("ArkUX_Stage_DataPanel_ValueColors_0400") + } + ListItem() { + DataPanel({ values: [10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(this.color4) + .key("ArkUX_Stage_DataPanel_ValueColors_0500") + } + ListItem() { + DataPanel({ values: [10, 10, 10, 10, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(this.color5) + .key("ArkUX_Stage_DataPanel_ValueColors_0600") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(['rgb(255,0,0)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(0,0,0)']) + .valueColors([Color.Red, Color.Green, Color.Blue, Color.Black]) + .key("ArkUX_Stage_DataPanel_ValueColors_0700") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(["#FFFF0000", "#FF00FF00", "#FF0000FF", "#FF000000"]) + .backgroundColor(Color.Pink) + .width(80) + .padding(10) + .margin(20) + .key("ArkUX_Stage_DataPanel_ValueColors_0800") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors('rgb(255,0,0)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(0,0,0)') + .valueColors(undefined) + .key("ArkUX_Stage_DataPanel_ValueColors_0900") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors([this.color6, this.color7, this.color8]) + .key("ArkUX_Stage_DataPanel_ValueColors_1000") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors([this.color9, this.color10, this.color11]) + .key("ArkUX_Stage_DataPanel_ValueColors_1100") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors([this.color12, this.color13, this.color14]) + .key("ArkUX_Stage_DataPanel_ValueColors_1200") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors([$r("app.color.DataPanel_ValueColors5"), $r("app.color.DataPanel_ValueColors6"), + $r("app.color.DataPanel_ValueColors7"), $r("app.color.DataPanel_ValueColors8"), + $r("app.color.DataPanel_ValueColors9"), $r("app.color.DataPanel_ValueColors10")]) + .key("ArkUX_Stage_DataPanel_ValueColors_1300") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors([this.color26, this.color27, this.color28]) + .valueColors([this.color29, this.color30, this.color31]) + .key("ArkUX_Stage_DataPanel_ValueColors_1400") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors([this.color23, this.color24, this.color25]) + .backgroundColor(Color.Green) + .padding(10) + .margin(20) + .key("ArkUX_Stage_DataPanel_ValueColors_1500") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(([{ color: 'rgb(255,165,0)', offset: 0 }, { color: 'rgb(255,255,0)', offset: 1 }], + [{ color: 'rgb(255,192,203)', offset: 0 }, { color: 'rgb(0,128,0)', offset: 1 }], + [{ color: 'rgb(0,0,255)', offset: 0 },{ color: 'rgb(255,0,0)', offset: 1 }])) + .valueColors(undefined) + .key("ArkUX_Stage_DataPanel_ValueColors_1600") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(this.color15) + .key("ArkUX_Stage_DataPanel_ValueColors_1700") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(this.color16) + .key("ArkUX_Stage_DataPanel_ValueColors_1800") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(this.color17) + .key("ArkUX_Stage_DataPanel_ValueColors_1900") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors([$r("app.color.DataPanel_ValueColors11"), $r("app.color.DataPanel_ValueColors12"), + $r("app.color.DataPanel_ValueColors13"), $r("app.color.DataPanel_ValueColors14")]) + .key("ArkUX_Stage_DataPanel_ValueColors_2000") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(['rgba(255,165,0,0)', 'rgba(255,255,0,0)', 'rgba(255,192,203,0)', 'rgba(0,128,0,0)']) + .valueColors([Color.Orange, Color.Yellow, Color.Pink, Color.Green]) + .key("ArkUX_Stage_DataPanel_ValueColors_2100") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(["#01FFA500", "#4CFFFF00", "#9AFFC0CB", "#FF00FF00"]) + .backgroundColor(Color.Green) + .padding(10) + .margin(20) + .key("ArkUX_Stage_DataPanel_ValueColors_2200") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors('') + .key("ArkUX_Stage_DataPanel_ValueColors_2300") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(null) + .key("ArkUX_Stage_DataPanel_ValueColors_2400") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(undefined) + .key("ArkUX_Stage_DataPanel_ValueColors_2500") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(['rgba(255,165,0,0)', 'rgba(0,255,255,0,0)', 'rgba(255,192,203,0)', 'rgba(0,0,128,0)']) + .valueColors(undefined) + .key("ArkUX_Stage_DataPanel_ValueColors_2600") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors('color') + .key("ArkUX_Stage_DataPanel_ValueColors_2700") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors(this.color18) + .key("ArkUX_Stage_DataPanel_ValueColors_2800") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .valueColors([this.color19, this.color39]) + .key("ArkUX_Stage_DataPanel_ValueColors_2900") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackBackgroundColor('#FF00FF00') + .key("ArkUX_Stage_DataPanel_TrackBackgroundColor_0100") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackBackgroundColor('rgb(0,255,0)') + .key("ArkUX_Stage_DataPanel_TrackBackgroundColor_0200") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackBackgroundColor(Color.Green) + .key("ArkUX_Stage_DataPanel_TrackBackgroundColor_0300") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackBackgroundColor($r("app.color.DataPanel_TrackBackgroundColor")) + .key("ArkUX_Stage_DataPanel_TrackBackgroundColor_0400") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackBackgroundColor("#FF00FF00") + .trackBackgroundColor(Color.Yellow) + .key("ArkUX_Stage_DataPanel_TrackBackgroundColor_0500") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackBackgroundColor("#FF0000FF") + .backgroundColor(Color.Green) + .padding(10) + .margin(20) + .key("ArkUX_Stage_DataPanel_TrackBackgroundColor_0600") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackBackgroundColor('') + .key("ArkUX_Stage_DataPanel_TrackBackgroundColor_0700") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackBackgroundColor(null) + .key("ArkUX_Stage_DataPanel_TrackBackgroundColor_0800") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackBackgroundColor(undefined) + .key("ArkUX_Stage_DataPanel_TrackBackgroundColor_0900") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackBackgroundColor("#FF00FF00") + .trackBackgroundColor(undefined) + .key("ArkUX_Stage_DataPanel_TrackBackgroundColor_1000") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackBackgroundColor('color') + .key("ArkUX_Stage_DataPanel_TrackBackgroundColor_1100") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .strokeWidth(30.00) + .key("ArkUX_Stage_DataPanel_StrokeWidth_0100") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .strokeWidth('30.00vp') + .key("ArkUX_Stage_DataPanel_StrokeWidth_0200") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .strokeWidth($r("app.string.DataPanel_StrokeWidth")) + .key("ArkUX_Stage_DataPanel_StrokeWidth_0300") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .strokeWidth('') + .key("ArkUX_Stage_DataPanel_StrokeWidth_0400") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .strokeWidth(null) + .key("ArkUX_Stage_DataPanel_StrokeWidth_0500") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .strokeWidth(undefined) + .key("ArkUX_Stage_DataPanel_StrokeWidth_0600") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ radius: 20 }) + .key("ArkUX_Stage_DataPanel_TrackShadow_0100") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ radius: -1 }) + .key("ArkUX_Stage_DataPanel_TrackShadow_0200") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ radius: '' }) + .key("ArkUX_Stage_DataPanel_TrackShadow_0300") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ radius: null }) + .key("ArkUX_Stage_DataPanel_TrackShadow_0400") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ radius: undefined }) + .key("ArkUX_Stage_DataPanel_TrackShadow_0500") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ offsetX: 15 }) + .key("ArkUX_Stage_DataPanel_TrackShadow_0600") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ offsetX: -10 }) + .key("ArkUX_Stage_DataPanel_TrackShadow_0700") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ offsetX: '' }) + .key("ArkUX_Stage_DataPanel_TrackShadow_0800") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ offsetX: null }) + .key("ArkUX_Stage_DataPanel_TrackShadow_0900") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ offsetX: undefined }) + .key("ArkUX_Stage_DataPanel_TrackShadow_1000") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ offsetY: 15 }) + .key("ArkUX_Stage_DataPanel_TrackShadow_1100") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ offsetY: -10 }) + .key("ArkUX_Stage_DataPanel_TrackShadow_1200") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ offsetY: '' }) + .key("ArkUX_Stage_DataPanel_TrackShadow_1300") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ offsetY: null }) + .key("ArkUX_Stage_DataPanel_TrackShadow_1400") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ offsetY: undefined }) + .key("ArkUX_Stage_DataPanel_TrackShadow_1500") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: this.color20 }) + .key("ArkUX_Stage_DataPanel_TrackShadow_1600") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: this.color21 }) + .key("ArkUX_Stage_DataPanel_TrackShadow_1700") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: this.color22 }) + .key("ArkUX_Stage_DataPanel_TrackShadow_1800") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: [$r("app.color.DataPanel_TrackShadow1"), $r("app.color.DataPanel_TrackShadow2"), + $r("app.color.DataPanel_TrackShadow3")] }) + .key("ArkUX_Stage_DataPanel_TrackShadow_1900") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: '' }) + .key("ArkUX_Stage_DataPanel_TrackShadow_2000") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: null }) + .key("ArkUX_Stage_DataPanel_TrackShadow_2100") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: undefined }) + .key("ArkUX_Stage_DataPanel_TrackShadow_2200") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: [this.color23, this.color24, this.color25] }) + .key("ArkUX_Stage_DataPanel_TrackShadow_2300") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: [this.color26, this.color27, this.color28] }) + .key("ArkUX_Stage_DataPanel_TrackShadow_2400") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: [this.color29, this.color30, this.color31]}) + .key("ArkUX_Stage_DataPanel_TrackShadow_2500") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: [$r("app.color.DataPanel_TrackShadow4"), $r("app.color.DataPanel_TrackShadow5"), + $r("app.color.DataPanel_TrackShadow6"), $r("app.color.DataPanel_TrackShadow7"), + $r("app.color.DataPanel_TrackShadow8"), $r("app.color.DataPanel_TrackShadow9")]}) + .key("ArkUX_Stage_DataPanel_TrackShadow_2600") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: '' }) + .key("ArkUX_Stage_DataPanel_TrackShadow_2700") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: null }) + .key("ArkUX_Stage_DataPanel_TrackShadow_2800") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: undefined }) + .key("ArkUX_Stage_DataPanel_TrackShadow_2900") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: this.colorArray1 }) + .key("ArkUX_Stage_DataPanel_TrackShadow_3000") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: this.colorArray2 }) + .key("ArkUX_Stage_DataPanel_TrackShadow_3100") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: this.colorArray3 }) + .key("ArkUX_Stage_DataPanel_TrackShadow_3200") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: [$r("app.color.DataPanel_TrackShadow10"), $r("app.color.DataPanel_TrackShadow11"), + $r("app.color.DataPanel_TrackShadow12")]}) + .key("ArkUX_Stage_DataPanel_TrackShadow_3300") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: '' }) + .key("ArkUX_Stage_DataPanel_TrackShadow_3400") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: null }) + .key("ArkUX_Stage_DataPanel_TrackShadow_3500") + } + ListItem() { + DataPanel({ values: [20, 10, 10], max: 80, type: DataPanelType.Circle }) + .width(200) + .height(200) + .trackShadow({ colors: undefined }) + .key("ArkUX_Stage_DataPanel_TrackShadow_3600") + } + } + } + .width('100%') + } + .height('100%') +} +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6c662824093f9339085214d247c6247faa86ae9 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s it', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${targetParams} ${key} ${parameters[key]}` + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/test/List.test.ets b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..8bd365c2fa99d5de74fc4e9af288b479bfa29981 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import datapanelTest from './datapanel' + +export default function testsuite() { + datapanelTest() +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/test/datapanel.ets b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/test/datapanel.ets new file mode 100644 index 0000000000000000000000000000000000000000..7be45e5645b569b19002e30e1e8fb717064d750d --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/test/datapanel.ets @@ -0,0 +1,3371 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// @ts-nocheck +import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' +import hilog from '@ohos.hilog'; + +let emitKey = "emitUserAgent"; + +export default function datapanelTest() { + describe('ActsDatapanelTest', function () { + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_0100 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * ["#FFFF0000", "#FF00FF00", "#FF0000FF", "#FF000000"] + */ + it('ArkUX_Stage_DataPanel_ValueColors_0100', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_0100'); + console.info('ArkUX_Stage_DataPanel_ValueColors_0100 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0100 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0100 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FF000000"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FF000000"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_0200 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * ['rgb(255,0,0)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(0,0,0)'] + */ + it('ArkUX_Stage_DataPanel_ValueColors_0200', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_0200'); + console.info('ArkUX_Stage_DataPanel_ValueColors_0200 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0200 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0200 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FF000000"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FF000000"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_0200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_0300 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * [Color.Red, Color.Green, Color.Blue, Color.Black] + */ + it('ArkUX_Stage_DataPanel_ValueColors_0300', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_0300'); + console.info('ArkUX_Stage_DataPanel_ValueColors_0300 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0300 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0300 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FF008000"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FF008000"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FF000000"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FF000000"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_0300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_0300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_0400 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * [$r("app.color.DataPanel_ValueColors1"), $r("app.color.DataPanel_ValueColors2"), + * $r("app.color.DataPanel_ValueColors3"), $r("app.color.DataPanel_ValueColors4")] + */ + it('ArkUX_Stage_DataPanel_ValueColors_0400', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_0400'); + console.info('ArkUX_Stage_DataPanel_ValueColors_0400 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + let valueColors = obj.$attrs.valueColors; + console.info("ArkUX_Stage_DataPanel_ValueColors_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0400 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0400 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + hilog.info(0x0000, 'testTag', '%{public}s', JSON.stringify(valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FF000000"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FF000000"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_0400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_0400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_0500 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * ["#FFFF0000", "#FF00FF00", "#FF0000FF", "#FF000000"] + */ + it('ArkUX_Stage_DataPanel_ValueColors_0500', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_0500'); + console.info('ArkUX_Stage_DataPanel_ValueColors_0500 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0500 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0500 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_0600 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * ["#FF000000", "#FFFF0000", "#FF00FF00"] + */ + it('ArkUX_Stage_DataPanel_ValueColors_0600', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_0600'); + console.info('ArkUX_Stage_DataPanel_ValueColors_0600 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0600 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0600 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FF000000"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FF000000"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_0600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_0700 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * ['rgb(255,0,0)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(0,0,0)'] + * DataPanel common components, set valueColors property once more parameter to + * [Color.Red, Color.Green, Color.Blue, Color.Black] + */ + it('ArkUX_Stage_DataPanel_ValueColors_0700', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_0700'); + console.info('ArkUX_Stage_DataPanel_ValueColors_0700 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0700 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0700 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FF008000"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FF008000"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FF000000"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FF000000"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_0700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_0700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_0800 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * ["#FFFF0000", "#FF00FF00", "#FF0000FF", "#FF000000"] + * set the general attribute backgroundColor parameter to Color.Pink + */ + it('ArkUX_Stage_DataPanel_ValueColors_0800', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_0800'); + console.info('ArkUX_Stage_DataPanel_ValueColors_0800 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0800 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0800 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FF000000"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FF000000"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_0800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_0800 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_0900 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * ['rgb(255,0,0)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(0,0,0)'], + * and set the valueColors parameter to undefined + */ + it('ArkUX_Stage_DataPanel_ValueColors_0900', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_0900'); + console.info('ArkUX_Stage_DataPanel_ValueColors_0900 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0900 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_0900 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.valueColors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.valueColors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.valueColors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.valueColors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.valueColors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.valueColors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.valueColors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.valueColors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.valueColors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.valueColors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_0900 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_0900 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_1000 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * [{ color: "#FFA500", offset: 0 }, { color: "#FFFFFF00", offset: 1 }]; + * [{ color: "#FFC0CB", offset: 0 }, { color: "#FF00FF00", offset: 1 }] + * [{ color: "#FF0000FF", offset: 0 }, { color: "#FFFF0000", offset: 1 }] + */ + it('ArkUX_Stage_DataPanel_ValueColors_1000', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_1000'); + console.info('ArkUX_Stage_DataPanel_ValueColors_1000 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1000 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1000 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_1000 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_1000 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_1100 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * [{ color: 'rgb(255,165,0)', offset: 0 }, { color: 'rgb(255,255,0)', offset: 1 }] + * [{ color: 'rgb(255,192,203)', offset: 0 }, { color: 'rgb(0,128,0)', offset: 1 }] + * [{ color: 'rgb(0,0,255)', offset: 0 }, { color: 'rgb(255,0,0)', offset: 1 }] + */ + it('ArkUX_Stage_DataPanel_ValueColors_1100', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_1100'); + console.info('ArkUX_Stage_DataPanel_ValueColors_1100 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1100 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1100 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FF008000"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_1100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_1100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_1200 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * [{ color: Color.Orange, offset: 0 }, { color: Color.Yellow, offset: 1 }] + * [{ color: Color.Pink, offset: 0 }, { color: Color.Green, offset: 1 }] + * [{ color: Color.Blue, offset: 0 }, { color: Color.Red, offset: 1 }] + */ + it('ArkUX_Stage_DataPanel_ValueColors_1200', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_1200'); + console.info('ArkUX_Stage_DataPanel_ValueColors_1200 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1200 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1200 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FF008000"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_1200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_1200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_1300 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * [$r("app.color.DataPanel_ValueColors5"), $r("app.color.DataPanel_ValueColors6"), + * $r("app.color.DataPanel_ValueColors7"), $r("app.color.DataPanel_ValueColors8"), + * $r("app.color.DataPanel_ValueColors9"), $r("app.color.DataPanel_ValueColors10")] + */ + it('ArkUX_Stage_DataPanel_ValueColors_1300', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_1300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_1300'); + console.info('ArkUX_Stage_DataPanel_ValueColors_1300 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + let valueColors = obj.$attrs.valueColors; + console.info("ArkUX_Stage_DataPanel_ValueColors_1300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1300 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1300 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + hilog.info(0x0000, 'testTag', '%{public}s', JSON.stringify(valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[4][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[4][1].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[5][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[5][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[5][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_1300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_1300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_1400 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * [{ color: 'rgb(255,165,0)', offset: 0 }, { color: 'rgb(255,255,0)', offset: 1 }] + * [{ color: 'rgb(255,192,203)', offset: 0 }, { color: 'rgb(0,128,0)', offset: 1 }] + * [{ color: 'rgb(0,0,255)', offset: 0 }, { color: 'rgb(255,0,0)', offset: 1 }], + * and set the valueColors parameter to + * [{ color: Color.Orange, offset: 0 }, { color: Color.Yellow, offset: 1 }] + * [{ color: Color.Pink, offset: 0 }, { color: Color.Green, offset: 1 }] + * [{ color: Color.Blue, offset: 0 }, { color: Color.Red, offset: 1 }] + */ + it('ArkUX_Stage_DataPanel_ValueColors_1400', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_1400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_1400'); + console.info('ArkUX_Stage_DataPanel_ValueColors_1400 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_1400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1400 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1400 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FF008000"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_1400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_1400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_1500 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * [{ color: "#FFA500", offset: 0 }, { color: "#FFFFFF00", offset: 1 }] + * [{ color: "#FFC0CB", offset: 0 }, { color: "#FF00FF00", offset: 1 }] + * [{ color: "#FF0000FF", offset: 0 }, { color: "#FFFF0000", offset: 1 }] + * set the general attribute backgroundColor parameter to Color.Green + */ + it('ArkUX_Stage_DataPanel_ValueColors_1500', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_1500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_1500'); + console.info('ArkUX_Stage_DataPanel_ValueColors_1500 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_1500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1500 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1500 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_1500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_1500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_1600 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * [{ color: 'rgb(255,165,0)', offset: 0 }, { color: 'rgb(255,255,0)', offset: 1 }], + * [{ color: 'rgb(255,192,203)', offset: 0 }, { color: 'rgb(0,128,0)', offset: 1 }], + * [{ color: 'rgb(0,0,255)', offset: 0 }, { color: 'rgb(255,0,0)', offset: 1 }] + * and set the valueColors parameter to undefined + */ + it('ArkUX_Stage_DataPanel_ValueColors_1600', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_1600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_1600'); + console.info('ArkUX_Stage_DataPanel_ValueColors_1600 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_1600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1600 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1600 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.valueColors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.valueColors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.valueColors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.valueColors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.valueColors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.valueColors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.valueColors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.valueColors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.valueColors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.valueColors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_1600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_1600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_1700 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * ["#01FFA500", "#4CFFFF00", "#9AFFC0CB", "#FF00FF00"] + */ + it('ArkUX_Stage_DataPanel_ValueColors_1700', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_1700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_1700'); + console.info('ArkUX_Stage_DataPanel_ValueColors_1700 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_1700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1700 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1700 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#01FFA500"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#01FFA500"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#4CFFFF00"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#4CFFFF00"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#9AFFC0CB"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#9AFFC0CB"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_1700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_1700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_1800 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * ['rgba(255,165,0,0)', 'rgba(255,255,0,0)', 'rgba(255,192,203,0)', 'rgba(0,128,0,0)'] + */ + it('ArkUX_Stage_DataPanel_ValueColors_1800', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_1800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_1800'); + console.info('ArkUX_Stage_DataPanel_ValueColors_1800 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_1800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1800 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1800 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#00FFA500"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#00FFA500"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#00FFFF00"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#00FFFF00"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#00FFC0CB"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#00FFC0CB"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#00008000"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#00008000"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_1800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_1800 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_1900 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * [Color.Orange, Color.Yellow, Color.Pink, Color.Green] + */ + it('ArkUX_Stage_DataPanel_ValueColors_1900', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_1900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_1900'); + console.info('ArkUX_Stage_DataPanel_ValueColors_1900 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_1900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1900 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_1900 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FF008000"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FF008000"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_1900 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_1900 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_2000 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * [$r("app.color.DataPanel_ValueColors11"), $r("app.color.DataPanel_ValueColors12"), + * $r("app.color.DataPanel_ValueColors13"), $r("app.color.DataPanel_ValueColors14")] + */ + it('ArkUX_Stage_DataPanel_ValueColors_2000', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_2000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_2000'); + console.info('ArkUX_Stage_DataPanel_ValueColors_2000 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + let valueColors = obj.$attrs.valueColors; + console.info("ArkUX_Stage_DataPanel_ValueColors_2000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2000 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2000 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + hilog.info(0x0000, 'testTag', '%{public}s', JSON.stringify(valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#01FFA500"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#01FFA500"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#4CFF0000"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#4CFF0000"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#9AC0CB00"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#9AC0CB00"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_2000 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_2000 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_2100 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * ['rgba(255,165,0,0)', 'rgba(255,255,0,0)', 'rgba(255,192,203,0)', 'rgba(0,128,0,0)'], + * and set the valueColors parameter to [Color.Orange, Color.Yellow, Color.Pink, Color.Green] + */ + it('ArkUX_Stage_DataPanel_ValueColors_2100', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_2100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_2100'); + console.info('ArkUX_Stage_DataPanel_ValueColors_2100 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_2100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2100 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2100 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FF008000"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FF008000"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_2100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_2100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_2200 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * ["#01FFA500", "#4CFFFF00", "#9AFFC0CB", "#FF00FF00"], + * set the general attribute backgroundColor parameter to Color.Green + */ + it('ArkUX_Stage_DataPanel_ValueColors_2200', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_2200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_2200'); + console.info('ArkUX_Stage_DataPanel_ValueColors_2200 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_2200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2200 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2200 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#01FFA500"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#01FFA500"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#4CFFFF00"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#4CFFFF00"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#9AFFC0CB"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#9AFFC0CB"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_2200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_2200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_2300 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to '' + */ + it('ArkUX_Stage_DataPanel_ValueColors_2300', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_2300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_2300'); + console.info('ArkUX_Stage_DataPanel_ValueColors_2300 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_2300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2300 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2300 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.valueColors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.valueColors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.valueColors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.valueColors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.valueColors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.valueColors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.valueColors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.valueColors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.valueColors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.valueColors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_2300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_2300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_2400 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to null + */ + it('ArkUX_Stage_DataPanel_ValueColors_2400', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_2400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_2400'); + console.info('ArkUX_Stage_DataPanel_ValueColors_2400 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_2400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2400 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2400 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.valueColors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.valueColors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.valueColors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.valueColors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.valueColors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.valueColors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.valueColors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.valueColors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.valueColors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.valueColors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_2400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_2400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_2500 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to undefined + */ + it('ArkUX_Stage_DataPanel_ValueColors_2500', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_2500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_2500'); + console.info('ArkUX_Stage_DataPanel_ValueColors_2500 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_2500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2500 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2500 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.valueColors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.valueColors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.valueColors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.valueColors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.valueColors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.valueColors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.valueColors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.valueColors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.valueColors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.valueColors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_2500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_2500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_2600 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * ['rgba(255,165,0,0)', 'rgba(0,255,255,0,0)', 'rgba(255,192,203,0)', 'rgba(0,0,128,0)'], + * and set the valueColors parameter to undefined + */ + it('ArkUX_Stage_DataPanel_ValueColors_2600', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_2600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_2600'); + console.info('ArkUX_Stage_DataPanel_ValueColors_2600 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_2600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2600 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2600 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.valueColors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.valueColors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.valueColors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.valueColors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.valueColors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.valueColors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.valueColors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.valueColors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.valueColors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.valueColors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_2600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_2600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_2700 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to 'color' + */ + it('ArkUX_Stage_DataPanel_ValueColors_2700', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_2700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_2700'); + console.info('ArkUX_Stage_DataPanel_ValueColors_2700 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_2700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2700 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2700 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.valueColors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.valueColors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.valueColors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.valueColors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.valueColors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.valueColors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.valueColors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.valueColors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.valueColors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.valueColors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_2700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_2700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_2800 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * ["#01FFA500", "#4C800080", "#9AFFFF00", "#FF00FF00"] + */ + it('ArkUX_Stage_DataPanel_ValueColors_2800', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_2800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_2800'); + console.info('ArkUX_Stage_DataPanel_ValueColors_2800 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_2800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2800 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2800 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#01FFA500"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#01FFA500"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#4C800080"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#4C800080"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[2][0].color).assertEqual("#9AFFFF00"); + expect(obj.$attrs.valueColors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[2][1].color).assertEqual("#9AFFFF00"); + expect(obj.$attrs.valueColors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[3][0].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[3][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.valueColors[3][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_2800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_2800 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_ValueColors_2900 + * @tc.name Tests the valueColors property of the DataPanel component + * @tc.desc DataPanel common components, set valueColors property parameter to + * [{ color: "#01FFA500", offset: 0 }, { color: "#01FFFF00", offset: 1 }], + * [{ color: "#01FFC0CB", offset: 0 }, { color: "#0100FF00", offset: 1 }] + */ + it('ArkUX_Stage_DataPanel_ValueColors_2900', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_ValueColors_2900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_ValueColors_2900'); + console.info('ArkUX_Stage_DataPanel_ValueColors_2900 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_ValueColors_2900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2900 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_ValueColors_2900 component obj.$attrs.valueColors is: " + + JSON.stringify(obj.$attrs.valueColors)); + expect(obj.$attrs.valueColors[0][0].color).assertEqual("#01FFA500"); + expect(obj.$attrs.valueColors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[0][1].color).assertEqual("#01FFFF00"); + expect(obj.$attrs.valueColors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.valueColors[1][0].color).assertEqual("#01FFC0CB"); + expect(obj.$attrs.valueColors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.valueColors[1][1].color).assertEqual("#0100FF00"); + expect(obj.$attrs.valueColors[1][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_ValueColors_2900 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_ValueColors_2900 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackBackgroundColor_0100 + * @tc.name Tests the trackBackgroundColor property of the DataPanel component + * @tc.desc DataPanel common components, set trackBackgroundColor property parameter to '#FF00FF00' + */ + it('ArkUX_Stage_DataPanel_TrackBackgroundColor_0100', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackBackgroundColor_0100'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0100 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0100 component obj.$attrs.trackBackgroundColor is:" + + JSON.stringify(obj.$attrs.trackBackgroundColor)); + expect(obj.$attrs.trackBackgroundColor).assertEqual('#FF00FF00'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackBackgroundColor_0200 + * @tc.name Tests the trackBackgroundColor property of the DataPanel component + * @tc.desc DataPanel common components, set trackBackgroundColor property parameter to 'rgb(0,255,0)' + */ + it('ArkUX_Stage_DataPanel_TrackBackgroundColor_0200', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackBackgroundColor_0200'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0200 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0200 component obj.$attrs.trackBackgroundColor is:" + + JSON.stringify(obj.$attrs.trackBackgroundColor)); + expect(obj.$attrs.trackBackgroundColor).assertEqual('#FF00FF00'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackBackgroundColor_0300 + * @tc.name Tests the trackBackgroundColor property of the DataPanel component + * @tc.desc DataPanel common components, set trackBackgroundColor property parameter to Color.Green + */ + it('ArkUX_Stage_DataPanel_TrackBackgroundColor_0300', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackBackgroundColor_0300'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0300 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0300 component obj.$attrs.trackBackgroundColor is:" + + JSON.stringify(obj.$attrs.trackBackgroundColor)); + expect(obj.$attrs.trackBackgroundColor).assertEqual('#FF008000'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackBackgroundColor_0400 + * @tc.name Tests the trackBackgroundColor property of the DataPanel component + * @tc.desc DataPanel common components, set trackBackgroundColor property parameter to + * $r("app.color.DataPanel_TrackBackgroundColor") + */ + it('ArkUX_Stage_DataPanel_TrackBackgroundColor_0400', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackBackgroundColor_0400'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0400 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0400 component obj.$attrs.trackBackgroundColor is:" + + JSON.stringify(obj.$attrs.trackBackgroundColor)); + expect(obj.$attrs.trackBackgroundColor).assertEqual('#FF00FF00'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackBackgroundColor_0500 + * @tc.name Tests the trackBackgroundColor property of the DataPanel component + * @tc.desc DataPanel common components, set trackBackgroundColor property parameter to "#FF00FF00" + * DataPanel common components, set trackBackgroundColor property once more parameter to Color.Yellow + */ + it('ArkUX_Stage_DataPanel_TrackBackgroundColor_0500', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackBackgroundColor_0500'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0500 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0500 component obj.$attrs.trackBackgroundColor is:" + + JSON.stringify(obj.$attrs.trackBackgroundColor)); + expect(obj.$attrs.trackBackgroundColor).assertEqual('#FFFFFF00'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackBackgroundColor_0600 + * @tc.name Tests the trackBackgroundColor property of the DataPanel component + * @tc.desc DataPanel common components, set trackBackgroundColor property parameter to "#FF0000FF", + * set the general attribute backgroundColor parameter to Color.Green + */ + it('ArkUX_Stage_DataPanel_TrackBackgroundColor_0600', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackBackgroundColor_0600'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0600 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0600 component obj.$attrs.trackBackgroundColor is:" + + JSON.stringify(obj.$attrs.trackBackgroundColor)); + expect(obj.$attrs.trackBackgroundColor).assertEqual('#FF0000FF'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackBackgroundColor_0700 + * @tc.name Tests the trackBackgroundColor property of the DataPanel component + * @tc.desc DataPanel common components, set trackBackgroundColor property parameter to '' + */ + it('ArkUX_Stage_DataPanel_TrackBackgroundColor_0700', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackBackgroundColor_0700'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0700 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0700 component obj.$attrs.trackBackgroundColor is:" + + JSON.stringify(obj.$attrs.trackBackgroundColor)); + expect(obj.$attrs.trackBackgroundColor).assertEqual('#08182431'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackBackgroundColor_0800 + * @tc.name Tests the trackBackgroundColor property of the DataPanel component + * @tc.desc DataPanel common components, set trackBackgroundColor property parameter to null + */ + it('ArkUX_Stage_DataPanel_TrackBackgroundColor_0800', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackBackgroundColor_0800'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0800 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0800 component obj.$attrs.trackBackgroundColor is:" + + JSON.stringify(obj.$attrs.trackBackgroundColor)); + expect(obj.$attrs.trackBackgroundColor).assertEqual('#08182431'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0800 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackBackgroundColor_0900 + * @tc.name Tests the trackBackgroundColor property of the DataPanel component + * @tc.desc DataPanel common components, set trackBackgroundColor property parameter to undefined + */ + it('ArkUX_Stage_DataPanel_TrackBackgroundColor_0900', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackBackgroundColor_0900'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0900 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0900 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_0900 component obj.$attrs.trackBackgroundColor is:" + + JSON.stringify(obj.$attrs.trackBackgroundColor)); + expect(obj.$attrs.trackBackgroundColor).assertEqual('#08182431'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0900 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_0900 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackBackgroundColor_1000 + * @tc.name Tests the trackBackgroundColor property of the DataPanel component + * @tc.desc DataPanel common components, set trackBackgroundColor property parameter to "#FF00FF00", + * and set the trackBackgroundColor parameter to undefined + */ + it('ArkUX_Stage_DataPanel_TrackBackgroundColor_1000', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackBackgroundColor_1000'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_1000 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_1000 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_1000 component obj.$attrs.trackBackgroundColor is:" + + JSON.stringify(obj.$attrs.trackBackgroundColor)); + expect(obj.$attrs.trackBackgroundColor).assertEqual('#08182431'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_1000 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_1000 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackBackgroundColor_1100 + * @tc.name Tests the trackBackgroundColor property of the DataPanel component + * @tc.desc DataPanel common components, set trackBackgroundColor property parameter to 'color' + */ + it('ArkUX_Stage_DataPanel_TrackBackgroundColor_1100', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackBackgroundColor_1100'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_1100 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_1100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackBackgroundColor_1100 component obj.$attrs.trackBackgroundColor is:" + + JSON.stringify(obj.$attrs.trackBackgroundColor)); + expect(obj.$attrs.trackBackgroundColor).assertEqual('#08182431'); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_1100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackBackgroundColor_1100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_StrokeWidth_0100 + * @tc.name Tests the strokeWidth property of the DataPanel component + * @tc.desc DataPanel common components, set strokeWidth property parameter to 30.00 + */ + it('ArkUX_Stage_DataPanel_StrokeWidth_0100', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_StrokeWidth_0100'); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0100 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0100 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0100 component obj.$attrs.strokeWidth is: " + + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.strokeWidth).assertEqual("30.00vp"); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_StrokeWidth_0200 + * @tc.name Tests the strokeWidth property of the DataPanel component + * @tc.desc DataPanel common components, set strokeWidth property parameter to '30.00vp' + */ + it('ArkUX_Stage_DataPanel_StrokeWidth_0200', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_StrokeWidth_0200'); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0200 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0200 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0200 component obj.$attrs.strokeWidth is: " + + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.strokeWidth).assertEqual("30.00vp"); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_StrokeWidth_0300 + * @tc.name Tests the strokeWidth property of the DataPanel component + * @tc.desc DataPanel common components, set strokeWidth property parameter to + * $r("app.string.DataPanel_StrokeWidth") + */ + it('ArkUX_Stage_DataPanel_StrokeWidth_0300', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_StrokeWidth_0300'); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0300 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0300 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0300 component obj.$attrs.strokeWidth is: " + + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.strokeWidth).assertEqual("30.00vp"); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_StrokeWidth_0400 + * @tc.name Tests the strokeWidth property of the DataPanel component + * @tc.desc DataPanel common components, set strokeWidth property parameter to '' + */ + it('ArkUX_Stage_DataPanel_StrokeWidth_0400', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_StrokeWidth_0400'); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0400 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0400 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0400 component obj.$attrs.strokeWidth is: " + + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.strokeWidth).assertEqual("24.00vp"); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_StrokeWidth_0500 + * @tc.name Tests the strokeWidth property of the DataPanel component + * @tc.desc DataPanel common components, set strokeWidth property parameter to null + */ + it('ArkUX_Stage_DataPanel_StrokeWidth_0500', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_StrokeWidth_0500'); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0500 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0500 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0500 component obj.$attrs.strokeWidth is: " + + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.strokeWidth).assertEqual("24.00vp"); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_StrokeWidth_0600 + * @tc.name Tests the strokeWidth property of the DataPanel component + * @tc.desc DataPanel common components, set strokeWidth property parameter to undefined + */ + it('ArkUX_Stage_DataPanel_StrokeWidth_0600', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_StrokeWidth_0600'); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0600 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0600 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_StrokeWidth_0600 component obj.$attrs.strokeWidth is: " + + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.strokeWidth).assertEqual("24.00vp"); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_StrokeWidth_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_0100 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.radius : 20 + */ + it('ArkUX_Stage_DataPanel_TrackShadow_0100', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_0100'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0100 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0100 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0100 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + let trackShadow = obj.$attrs.trackShadow; + hilog.info(0x0000, 'testTag', '%{public}s', JSON.stringify(trackShadow.radius)); + expect(trackShadow.radius).assertEqual("20.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_0200 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.radius : -1 + */ + it('ArkUX_Stage_DataPanel_TrackShadow_0200', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_0200'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0200 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0200 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0200 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.radius).assertEqual("-1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_0300 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.radius : '' + */ + it('ArkUX_Stage_DataPanel_TrackShadow_0300', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_0300'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0300 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0300 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0300 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.radius).assertEqual("5.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_0400 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.radius : null + */ + it('ArkUX_Stage_DataPanel_TrackShadow_0400', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_0400'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0400 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0400 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0400 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.radius).assertEqual("5.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_0500 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.radius : undefined + */ + it('ArkUX_Stage_DataPanel_TrackShadow_0500', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_0500'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0500 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0500 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0500 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.radius).assertEqual("5.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_0600 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.offsetX : 15 + */ + it('ArkUX_Stage_DataPanel_TrackShadow_0600', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_0600'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0600 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0600 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0600 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.offsetX).assertEqual("15.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_0700 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.offsetX : -10 + */ + it('ArkUX_Stage_DataPanel_TrackShadow_0700', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_0700'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0700 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0700 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0700 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.offsetX).assertEqual("-10.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_0800 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.offsetX : '' + */ + it('ArkUX_Stage_DataPanel_TrackShadow_0800', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_0800'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0800 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0800 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0800 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.offsetX).assertEqual("5.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0800 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_0900 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.offsetX : null + */ + it('ArkUX_Stage_DataPanel_TrackShadow_0900', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_0900'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0900 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0900 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_0900 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.offsetX).assertEqual("5.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0900 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_0900 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_1000 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.offsetX : undefined + */ + it('ArkUX_Stage_DataPanel_TrackShadow_1000', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_1000'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1000 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1000 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1000 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.offsetX).assertEqual("5.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1000 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1000 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_1100 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.offsetY : 15 + */ + it('ArkUX_Stage_DataPanel_TrackShadow_1100', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_1100'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1100 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1100 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1100 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.offsetY).assertEqual("15.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_1200 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.offsetY : -10 + */ + it('ArkUX_Stage_DataPanel_TrackShadow_1200', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_1200'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1200 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1200 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1200 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.offsetY).assertEqual("-10.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_1300 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.offsetY : '' + */ + it('ArkUX_Stage_DataPanel_TrackShadow_1300', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_1300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_1300'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1300 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1300 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1300 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.offsetY).assertEqual("5.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_1400 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.offsetY : null + */ + it('ArkUX_Stage_DataPanel_TrackShadow_1400', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_1400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_1400'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1400 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1400 component obj.$attrs is: " + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1400 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.offsetY).assertEqual("5.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_1500 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.offsetY : undefined + */ + it('ArkUX_Stage_DataPanel_TrackShadow_1500', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_1500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_1500'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1500 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1500 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.offsetY).assertEqual("5.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_1600 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors: + * ["#FFFF0000", "#FFFFFF00", "#FF00FF00"] + */ + it('ArkUX_Stage_DataPanel_TrackShadow_1600', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_1600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_1600'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1600 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1600 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_1700 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors: + * ['rgb(255,0,0)', 'rgb(255,255,0)', 'rgb(0,255,0)'] + */ + it('ArkUX_Stage_DataPanel_TrackShadow_1700', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_1700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_1700'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1700 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1700 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_1800 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors: + * [Color.Red, Color.Yellow, Color.Green] + */ + it('ArkUX_Stage_DataPanel_TrackShadow_1800', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_1800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_1800'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1800 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1800 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FF008000"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FF008000"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1800 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_1900 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors: + * [$r("app.color.DataPanel_TrackShadow1"),$r("app.color.DataPanel_TrackShadow2"), + * $r("app.color.DataPanel_TrackShadow3")] } + */ + it('ArkUX_Stage_DataPanel_TrackShadow_1900', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_1900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_1900'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1900 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + let trackShadow = obj.$attrs.trackShadow; + console.info("ArkUX_Stage_DataPanel_TrackShadow_1900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1900 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_1900 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + hilog.info(0x0000, 'testTag', '%{public}s', JSON.stringify(obj.$attrs.trackShadow.colors)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1900 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_1900 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_2000 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors : '' + */ + it('ArkUX_Stage_DataPanel_TrackShadow_2000', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_2000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_2000'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2000 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + let trackShadow = obj.$attrs.trackShadow; + console.info("ArkUX_Stage_DataPanel_TrackShadow_2000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2000 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2000 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + hilog.info(0x0000, 'testTag', '%{public}s', JSON.stringify(obj.$attrs.trackShadow.colors)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.trackShadow.colors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.trackShadow.colors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.trackShadow.colors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.trackShadow.colors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.trackShadow.colors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.trackShadow.colors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.trackShadow.colors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.trackShadow.colors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.trackShadow.colors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.trackShadow.colors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.trackShadow.colors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.trackShadow.colors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2000 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2000 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_2100 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors : null + */ + it('ArkUX_Stage_DataPanel_TrackShadow_2100', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_2100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_2100'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2100 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + let trackShadow = obj.$attrs.trackShadow; + console.info("ArkUX_Stage_DataPanel_TrackShadow_2100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2100 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + hilog.info(0x0000, 'testTag', '%{public}s', JSON.stringify(obj.$attrs.trackShadow.colors)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.trackShadow.colors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.trackShadow.colors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.trackShadow.colors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.trackShadow.colors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.trackShadow.colors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.trackShadow.colors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.trackShadow.colors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.trackShadow.colors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.trackShadow.colors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.trackShadow.colors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.trackShadow.colors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.trackShadow.colors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_2200 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors : undefined + */ + it('ArkUX_Stage_DataPanel_TrackShadow_2200', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_2200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_2200'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2200 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + let trackShadow = obj.$attrs.trackShadow; + console.info("ArkUX_Stage_DataPanel_TrackShadow_2200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2200 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + hilog.info(0x0000, 'testTag', '%{public}s', JSON.stringify(obj.$attrs.trackShadow.colors)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.trackShadow.colors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.trackShadow.colors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.trackShadow.colors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.trackShadow.colors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.trackShadow.colors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.trackShadow.colors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.trackShadow.colors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.trackShadow.colors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.trackShadow.colors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.trackShadow.colors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.trackShadow.colors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.trackShadow.colors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_2300 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors: + * [{ color: "#FFA500", offset: 0 }, { color: "#FFFFFF00", offset: 1 }], + * [{ color: "#FFC0CB", offset: 0 }, { color: "#FF00FF00", offset: 1 }], + * [{ color: "#FF0000FF", offset: 0 }, { color: "#FFFF0000", offset: 1 }] + */ + it('ArkUX_Stage_DataPanel_TrackShadow_2300', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_2300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_2300'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2300 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2300 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_2400 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors: + * [{ color: 'rgb(255,165,0)', offset: 0 }, { color: 'rgb(255,255,0)', offset: 1 }] + * [{ color: 'rgb(255,192,203)', offset: 0 }, { color: 'rgb(0,128,0)', offset: 1 }] + * [{ color: 'rgb(0,0,255)', offset: 0 }, { color: 'rgb(255,0,0)', offset: 1 }] + */ + it('ArkUX_Stage_DataPanel_TrackShadow_2400', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_2400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_2400'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2400 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2400 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FF008000"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_2500 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors: + * [{ color: Color.Orange, offset: 0 }, { color: Color.Yellow, offset: 1 }] + * [{ color: Color.Pink, offset: 0 }, { color: Color.Green, offset: 1 }] + * [{ color: Color.Blue, offset: 0 }, { color: Color.Red, offset: 1 }] + */ + it('ArkUX_Stage_DataPanel_TrackShadow_2500', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_2500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_2500'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2500 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2500 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FF008000"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_2600 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors: + * [$r("app.color.DataPanel_TrackShadow4"), $r("app.color.DataPanel_TrackShadow5"), + * $r("app.color.DataPanel_TrackShadow6"), $r("app.color.DataPanel_TrackShadow7"), + * $r("app.color.DataPanel_TrackShadow8"), $r("app.color.DataPanel_TrackShadow9")] + */ + it('ArkUX_Stage_DataPanel_TrackShadow_2600', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_2600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_2600'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2600 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2600 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFFFFF00"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[3][0].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.trackShadow.colors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[3][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.trackShadow.colors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[4][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.trackShadow.colors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[4][1].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.trackShadow.colors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[5][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[5][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[5][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_2700 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors : '' + */ + it('ArkUX_Stage_DataPanel_TrackShadow_2700', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_2700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_2700'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2700 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + let trackShadow = obj.$attrs.trackShadow; + console.info("ArkUX_Stage_DataPanel_TrackShadow_2700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2700 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + hilog.info(0x0000, 'testTag', '%{public}s', JSON.stringify(obj.$attrs.trackShadow.colors)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.trackShadow.colors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.trackShadow.colors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.trackShadow.colors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.trackShadow.colors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.trackShadow.colors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.trackShadow.colors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.trackShadow.colors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.trackShadow.colors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.trackShadow.colors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.trackShadow.colors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.trackShadow.colors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.trackShadow.colors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_2800 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors : null + */ + it('ArkUX_Stage_DataPanel_TrackShadow_2800', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_2800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_2800'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2800 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + let trackShadow = obj.$attrs.trackShadow; + console.info("ArkUX_Stage_DataPanel_TrackShadow_2800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2800 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + hilog.info(0x0000, 'testTag', '%{public}s', JSON.stringify(obj.$attrs.trackShadow.colors)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.trackShadow.colors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.trackShadow.colors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.trackShadow.colors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.trackShadow.colors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.trackShadow.colors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.trackShadow.colors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.trackShadow.colors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.trackShadow.colors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.trackShadow.colors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.trackShadow.colors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.trackShadow.colors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.trackShadow.colors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2800 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_2800 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors : undefined + */ + it('ArkUX_Stage_DataPanel_TrackShadow_2900', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_2900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_2900'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2900 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + let trackShadow = obj.$attrs.trackShadow; + console.info("ArkUX_Stage_DataPanel_TrackShadow_2900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2900 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_2900 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + hilog.info(0x0000, 'testTag', '%{public}s', JSON.stringify(obj.$attrs.trackShadow.colors)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.trackShadow.colors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.trackShadow.colors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.trackShadow.colors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.trackShadow.colors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.trackShadow.colors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.trackShadow.colors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.trackShadow.colors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.trackShadow.colors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.trackShadow.colors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.trackShadow.colors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.trackShadow.colors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.trackShadow.colors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2900 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_2900 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_3000 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors: + * ["#FF0000FF", [{ color: "#FFA500", offset: 0 }, { color: "#FFC0CB", offset: 1 }]] + */ + it('ArkUX_Stage_DataPanel_TrackShadow_3000', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_3000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_3000'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3000 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3000 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3000 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FF0000FF"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3000 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3000 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_3100 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors: + * ['rgb(255,0,0)', [{ color: 'rgb(255,165,0)', offset: 0 }, { color: 'rgb(255,192,203)', offset: 1}]] + */ + it('ArkUX_Stage_DataPanel_TrackShadow_3100', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_3100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_3100'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3100 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3100 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_3200 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors: + * [Color.Red, [{ color: Color.Orange, offset: 0 }, { color: Color.Pink, offset: 1 }]] + */ + it('ArkUX_Stage_DataPanel_TrackShadow_3200', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_3200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_3200'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3200 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3200 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFFFA500"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_3300 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors: + * [$r("app.color.DataPanel_TrackShadow10"), $r("app.color.DataPanel_TrackShadow11"), + * $r("app.color.DataPanel_TrackShadow12")] + */ + it('ArkUX_Stage_DataPanel_TrackShadow_3300', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_3300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_3300'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3300 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3300 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFFFC0CB"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FF00FF00"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FFFF0000"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_3400 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors: '' + */ + it('ArkUX_Stage_DataPanel_TrackShadow_3400', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_3400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_3400'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3400 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + let trackShadow = obj.$attrs.trackShadow; + console.info("ArkUX_Stage_DataPanel_TrackShadow_3400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3400 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + hilog.info(0x0000, 'testTag', '%{public}s', JSON.stringify(obj.$attrs.trackShadow.colors)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.trackShadow.colors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.trackShadow.colors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.trackShadow.colors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.trackShadow.colors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.trackShadow.colors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.trackShadow.colors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.trackShadow.colors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.trackShadow.colors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.trackShadow.colors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.trackShadow.colors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.trackShadow.colors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.trackShadow.colors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_3500 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors: null + */ + it('ArkUX_Stage_DataPanel_TrackShadow_3500', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_3500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_3500'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3500 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + let trackShadow = obj.$attrs.trackShadow; + console.info("ArkUX_Stage_DataPanel_TrackShadow_3500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3500 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + hilog.info(0x0000, 'testTag', '%{public}s', JSON.stringify(obj.$attrs.trackShadow.colors)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.trackShadow.colors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.trackShadow.colors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.trackShadow.colors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.trackShadow.colors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.trackShadow.colors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.trackShadow.colors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.trackShadow.colors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.trackShadow.colors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.trackShadow.colors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.trackShadow.colors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.trackShadow.colors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.trackShadow.colors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_DataPanel_TrackShadow_3600 + * @tc.name Tests the trackShadow property of the DataPanel component + * @tc.desc DataPanel common components, set trackShadow property parameter to trackShadow.colors: undefined + */ + it('ArkUX_Stage_DataPanel_TrackShadow_3600', 0, async function (done) { + console.info('ArkUX_Stage_DataPanel_TrackShadow_3600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_DataPanel_TrackShadow_3600'); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3600 strJson :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + let trackShadow = obj.$attrs.trackShadow; + console.info("ArkUX_Stage_DataPanel_TrackShadow_3600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_DataPanel_TrackShadow_3600 component obj.$attrs.trackShadow is: " + + JSON.stringify(obj.$attrs.trackShadow)); + hilog.info(0x0000, 'testTag', '%{public}s', JSON.stringify(obj.$attrs.trackShadow.colors)); + expect(obj.$attrs.trackShadow.colors[0][0].color).assertEqual("#FFF7CE00"); + expect(obj.$attrs.trackShadow.colors[0][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[0][1].color).assertEqual("#FFF99B11"); + expect(obj.$attrs.trackShadow.colors[0][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[1][0].color).assertEqual("#FFF76223"); + expect(obj.$attrs.trackShadow.colors[1][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[1][1].color).assertEqual("#FFF2400A"); + expect(obj.$attrs.trackShadow.colors[1][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[2][0].color).assertEqual("#FFF772AC"); + expect(obj.$attrs.trackShadow.colors[2][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[2][1].color).assertEqual("#FFE65392"); + expect(obj.$attrs.trackShadow.colors[2][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[3][0].color).assertEqual("#FFA575EB"); + expect(obj.$attrs.trackShadow.colors[3][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[3][1].color).assertEqual("#FFA12DF7"); + expect(obj.$attrs.trackShadow.colors[3][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[4][0].color).assertEqual("#FF7B79F7"); + expect(obj.$attrs.trackShadow.colors[4][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[4][1].color).assertEqual("#FF4B48F7"); + expect(obj.$attrs.trackShadow.colors[4][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[5][0].color).assertEqual("#FF4B8AF3"); + expect(obj.$attrs.trackShadow.colors[5][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[5][1].color).assertEqual("#FF007DFF"); + expect(obj.$attrs.trackShadow.colors[5][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[6][0].color).assertEqual("#FF73C1E6"); + expect(obj.$attrs.trackShadow.colors[6][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[6][1].color).assertEqual("#FF4FB4E3"); + expect(obj.$attrs.trackShadow.colors[6][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[7][0].color).assertEqual("#FFA5D61D"); + expect(obj.$attrs.trackShadow.colors[7][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[7][1].color).assertEqual("#FF69D14F"); + expect(obj.$attrs.trackShadow.colors[7][1].offset).assertEqual("1.000000"); + expect(obj.$attrs.trackShadow.colors[8][0].color).assertEqual("#FFA2A2B0"); + expect(obj.$attrs.trackShadow.colors[8][0].offset).assertEqual("0.000000"); + expect(obj.$attrs.trackShadow.colors[8][1].color).assertEqual("#FF8E8E93"); + expect(obj.$attrs.trackShadow.colors[8][1].offset).assertEqual("1.000000"); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_DataPanel_TrackShadow_3600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + }) +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/module.json b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..fd47168641b845c0b3543fb2f2bbd4c5172f3cf7 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/module.json @@ -0,0 +1,43 @@ +{ + "module": { + "name": "phone", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "visible": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/resources/base/element/color.json b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..1660ea2521c6b13b4e7f548fc0bc9c3fbfed44b1 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/resources/base/element/color.json @@ -0,0 +1,116 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "DataPanel_TrackBackgroundColor", + "value": "#FF00FF00" + }, + { + "name": "DataPanel_ValueColors1", + "value": "#FFFF0000" + }, + { + "name": "DataPanel_ValueColors2", + "value": "#FF00FF00" + }, + { + "name": "DataPanel_ValueColors3", + "value": "#FF0000FF" + }, + { + "name": "DataPanel_ValueColors4", + "value": "#FF000000" + }, + { + "name": "DataPanel_ValueColors5", + "value": "#FFA500" + }, + { + "name": "DataPanel_ValueColors6", + "value": "#FFFFFF00" + }, + { + "name": "DataPanel_ValueColors7", + "value": "#FFC0CB" + }, + { + "name": "DataPanel_ValueColors8", + "value": "#FF00FF00" + }, + { + "name": "DataPanel_ValueColors9", + "value": "#FF0000FF" + }, + { + "name": "DataPanel_ValueColors10", + "value": "#FFFF0000" + }, + { + "name": "DataPanel_ValueColors11", + "value": "#01FFA500" + }, + { + "name": "DataPanel_ValueColors12", + "value": "#4CFF0000" + }, + { + "name": "DataPanel_ValueColors13", + "value": "#9AC0CB00" + }, + { + "name": "DataPanel_ValueColors14", + "value": "#FF00FF00" + }, + { + "name": "DataPanel_TrackShadow1", + "value": "#FFFF00" + }, + { + "name": "DataPanel_TrackShadow2", + "value": "#FFA500" + }, + { + "name": "DataPanel_TrackShadow3", + "value": "#FFC0CB" + }, + { + "name": "DataPanel_TrackShadow4", + "value": "#FFA500" + }, + { + "name": "DataPanel_TrackShadow5", + "value": "#FFFFFF00" + }, + { + "name": "DataPanel_TrackShadow6", + "value": "#FFC0CB" + }, + { + "name": "DataPanel_TrackShadow7", + "value": "#FF00FF00" + }, + { + "name": "DataPanel_TrackShadow8", + "value": "#FF0000FF" + }, + { + "name": "DataPanel_TrackShadow9", + "value": "#FFFF0000" + }, + { + "name": "DataPanel_TrackShadow10", + "value": "#FFC0CB" + }, + { + "name": "DataPanel_TrackShadow11", + "value": "#FF00FF00" + }, + { + "name": "DataPanel_TrackShadow12", + "value": "#FFFF0000" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..ac9f6f70eec4a8372a7ce6bb60168d17b4b9bf22 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/resources/base/element/string.json @@ -0,0 +1,20 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + }, + { + "name": "DataPanel_StrokeWidth", + "value": "30.00vp" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/resources/base/media/icon.png b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/resources/base/media/icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/resources/base/profile/test_pages.json b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/resources/base/profile/test_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..9896fb184f3db11f1ed9c3b073fa044ffc170e26 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "TestAbility/pages/Index" + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/AppScope/app.json b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..0d55d941a9e70df6b8c47962b1655f6dc6bee37b --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/AppScope/app.json @@ -0,0 +1,19 @@ +{ + "app": { + "bundleName": "com.example.acedatepickertest", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/AppScope/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..30af7cfee6766dda361b893d1565490dc145fdf0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"MyApplication" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/AppScope/resources/base/media/app_icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/BUILD.gn b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..cdc9cf78ef4ca83d2d7caa20defdb542adc1b338 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/BUILD.gn @@ -0,0 +1,43 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAceDatePickerTest") { + hap_profile = "src/main/module.json" + js_build_mode = "debug" + deps = [ + ":ace_ets_component_datepicker_js_assets", + ":ace_ets_component_datepicker_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsAceDatePickerTest" + part_name = "ace_engine" + subsystem_name = "arkui" +} + +ohos_app_scope("ace_ets_component_datepicker_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("ace_ets_component_datepicker_js_assets") { + source_dir = "src/main/ets" +} + +ohos_resources("ace_ets_component_datepicker_resources") { + sources = [ "src/main/resources" ] + deps = [ ":ace_ets_component_datepicker_profile" ] + hap_profile = "src/main/module.json" +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/Test.json b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..9696f849d8c13c77599e02595e4a74bd9e302b51 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/Test.json @@ -0,0 +1,26 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "600000", + "bundle-name": "com.example.acedatepickertest", + "module-name": "phone", + "shell-timeout": "600000", + "testcase-timeout": 70000 + }, + "kits": [{ + "test-file-name": [ + "ActsAceDatePickerTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "power-shell wakeup", + "power-shell setmode 602" + ] + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/signature/openharmony_sx.p7b b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..2aefa8f9e326be8ba086a70f31c8b2082a1e9689 Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/signature/openharmony_sx.p7b differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/TestAbility/TestAbility.ets b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/TestAbility/TestAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..fc4e92b3ab3bfcf55c6562ba538d672cfa9458f0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/TestAbility/TestAbility.ets @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import hilog from '@ohos.hilog'; +import Ability from '@ohos.app.ability.UIAbility' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import testsuite from '../test/List.test' +import Window from '@ohos.window' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('TestAbility/pages/Index', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/TestAbility/pages/Index.ets b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/TestAbility/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..42fd08a18933f80aad1fe07ecdb62b3e25ce8d4e --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/TestAbility/pages/Index.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import hilog from '@ohos.hilog'; +import testsuite from '../../test/List.test' +@Entry +@Component +struct DatePickerExample { + + private selectedDate: Date = new Date('2021-08-08') + + @State disappearTextStyle: PickerTextStyle = {color:Color.Black,font:{size:8,weight:FontWeight.Lighter}} + @State textStyle: PickerTextStyle = {color:Color.Red,font:{size:'10px',weight:FontWeight.Normal}} + @State selectedTextStyle: PickerTextStyle = {color:Color.Blue,font:{size:'20px',weight:FontWeight.Bold}} + + private stateChangCallBack = (eventData) => { + console.info("select page state change called:" + JSON.stringify(eventData)); + if (eventData != null) { + if (eventData.data.disappearTextStyle != null) { + this.disappearTextStyle = JSON.parse(eventData.data.disappearTextStyle); + } + if (eventData.data.textStyle != null) { + this.textStyle = JSON.parse(eventData.data.textStyle); + } + if (eventData.data.selectedTextStyle != null) { + this.selectedTextStyle = JSON.parse(eventData.data.selectedTextStyle); + } + } + } + + aboutToAppear(){ + var stateChangeEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + events_emitter.on(stateChangeEvent, this.stateChangCallBack); + + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + build() { + Column() { + DatePicker({ + start: new Date('1970-1-1'), + end: new Date('2100-1-1'), + selected: this.selectedDate + }) + .lunar(true) + .disappearTextStyle(this.disappearTextStyle) + .textStyle(this.textStyle) + .selectedTextStyle(this.selectedTextStyle) + .key('datePicker') + .onChange((date: DatePickerResult) => { + console.info( 'select current date is: ' + JSON.stringify(date)) + }) + } + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6c662824093f9339085214d247c6247faa86ae9 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s it', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${targetParams} ${key} ${parameters[key]}` + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/test/DatePicker.ets b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/test/DatePicker.ets new file mode 100644 index 0000000000000000000000000000000000000000..7f9c037d0db9705ecabc69944dcd2ff583aa97de --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/test/DatePicker.ets @@ -0,0 +1,859 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// @ts-nocheck +import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' +import events_emitter from '@ohos.events.emitter'; +import Utils from './Utils.ets'; +export default function datepicker() { + describe('ActsAceDatePickerTest', function () { + beforeEach(async function (done) { + await Utils.sleep(2000); + console.info("datePicker beforeEach start"); + done(); + }) + + afterEach(async function (done) { + console.info("datePicker afterEach start"); + + try { + var eventData = { + data: { + "disappearTextStyle": {color:Color.Black,font:{size:8,weight:FontWeight.Lighter}}, + "textStyle": {color:Color.Red,font:{size:'10px',weight:FontWeight.Normal}}, + "selectedTextStyle": {color:Color.Blue,font:{size:'20px',weight:FontWeight.Bold}} + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[datePicker_afterEach] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[selectTest_afterEach] change component data error: " + err.message); + } + done(); + }) + + /* + * @tc.number ArkUI_Stage_datePicker_disappearTextStyle_0001 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc get the default value + */ + it('ArkUI_Stage_datePicker_disappearTextStyle_0001', 0, async function (done) { + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datePicker_disappearTextStyle_0001] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF000000'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('8.00fp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Lighter'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datePicker_disappearTextStyle_0002 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_datePicker_disappearTextStyle_0002', 0, async function (done) { + let value = {color:Color.Black,font:{size:8,weight:FontWeight.Bolder}} + try { + var eventData = { + data: { + "disappearTextStyle":JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datePicker_disappearTextStyle_0002] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datePicker_disappearTextStyle_0002] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.error("[ArkUI_Stage_dataPicker_disappearTextStyle_0002] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF000000'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('8.00fp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Bolder'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datePicker_disappearTextStyle_0003 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_datePicker_disappearTextStyle_0003', 0, async function (done) { + let value = {color:0x808080,font:{size:8,weight:100}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datePicker_disappearTextStyle_0003] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datePicker_disappearTextStyle_0003] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datePicker_disappearTextStyle_0003] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF808080'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('8.00fp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('100'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datePicker_disappearTextStyle_0004 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_datePicker_disappearTextStyle_0004', 0, async function (done) { + let value = {color:'#ff0000',font:{size:'1px',weight:'700'}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datePicker_disappearTextStyle_0004] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datePicker_disappearTextStyle_0004] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datePicker_disappearTextStyle_0004] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FFFF0000'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('1.00px'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('700'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datePicker_disappearTextStyle_0005 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_datePicker_disappearTextStyle_0005', 0, async function (done) { + let value = {color:Color.Green,font:{size:30,weight:450}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datePicker_disappearTextStyle_0005] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datePicker_disappearTextStyle_0005] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datePicker_disappearTextStyle_0005] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF008000'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('30.00fp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datePicker_disappearTextStyle_0006 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_datePicker_disappearTextStyle_0006', 0, async function (done) { + let value = {color:'#80808g',font:{size:-1,weight:1000}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datePicker_disappearTextStyle_0006] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datePicker_disappearTextStyle_0006] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datePicker_disappearTextStyle_0006] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF182431'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('14.00vp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datePicker_disappearTextStyle_0007 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_datePicker_disappearTextStyle_0007', 0, async function (done) { + let value = {color:'xxx',font:{size:'xxx',weight:FontWeight.Bold}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datePicker_disappearTextStyle_0007] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datePicker_disappearTextStyle_0007] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datePicker_disappearTextStyle_0007] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF182431'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('14.00vp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Bold'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_dataPicker_disappearTextStyle_0008 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_dataPicker_disappearTextStyle_0008', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'20vp',weight:900}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_dataPicker_disappearTextStyle_0008] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_dataPicker_disappearTextStyle_0008] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('20.00vp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('900'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_dataPicker_disappearTextStyle_0009 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_dataPicker_disappearTextStyle_0009', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'15lpx',weight:90}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_dataPicker_disappearTextStyle_0009] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_dataPicker_disappearTextStyle_0009] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('15.00lpx'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datePicker_textStyle_0001 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc get the default value + */ + it('ArkUI_Stage_datePicker_textStyle_0001', 0, async function (done) { + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datePicker_textStyle_0001] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FFFF0000'); + expect(obj.$attrs.textStyle.font.size).assertEqual('10.00px'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datePicker_textStyle_0002 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_datePicker_textStyle_0002', 0, async function (done) { + let value = {color:Color.Red,font:{size:'10px',weight:FontWeight.Bolder}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datePicker_textStyle_0002] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datePicker_textStyle_0002] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.error("[ArkUI_Stage_datePicker_textStyle_0002] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FFFF0000'); + expect(obj.$attrs.textStyle.font.size).assertEqual('10.00px'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Bolder'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datePicker_textStyle_0003 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_datePicker_textStyle_0003', 0, async function (done) { + let value = {color:0xFF808080,font:{size:'10px',weight:100}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datePicker_textStyle_0003] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datePicker_textStyle_0003] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datePicker_textStyle_0003] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FF808080'); + expect(obj.$attrs.textStyle.font.size).assertEqual('10.00px'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('100'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datePicker_textStyle_0004 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_datePicker_textStyle_0004', 0, async function (done) { + let value = {color:'#00ff00',font:{size:'1px',weight:'700'}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datePicker_textStyle_0004] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datePicker_textStyle_0004] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datePicker_textStyle_0004] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FF00FF00'); + expect(obj.$attrs.textStyle.font.size).assertEqual('1.00px'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('700'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datePicker_textStyle_0005 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_datePicker_textStyle_0005', 0, async function (done) { + let value = {color:Color.Green,font:{size:30,weight:450}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datePicker_textStyle_0005] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datePicker_textStyle_0005] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datePicker_textStyle_0005] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FF008000'); + expect(obj.$attrs.textStyle.font.size).assertEqual('30.00fp'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datePicker_textStyle_0006 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_datePicker_textStyle_0006', 0, async function (done) { + let value = {color:'#80808g',font:{size:-1,weight:1000}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_textStyle_0006] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datePicker_textStyle_0006] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datePicker_textStyle_0006] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FF182431'); + expect(obj.$attrs.textStyle.font.size).assertEqual('16.00vp'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datePicker_textStyle_0007 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_datePicker_textStyle_0007', 0, async function (done) { + let value = {color:'xxx',font:{size:'xxx',weight:FontWeight.Lighter}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datePicker_textStyle_0007] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datePicker_textStyle_0007] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datePicker_textStyle_0007] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FF182431'); + expect(obj.$attrs.textStyle.font.size).assertEqual('16.00vp'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Lighter'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datePicker_textStyle_0008 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_datePicker_textStyle_0008', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'20vp',weight:900}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datePicker_textStyle_0008] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datePicker_textStyle_0008] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.textStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.textStyle.font.size).assertEqual('20.00vp'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('900'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datePicker_textStyle_0009 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_datePicker_textStyle_0009', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'15lpx',weight:90}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datePicker_textStyle_0009] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datePicker_textStyle_0009] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.textStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.textStyle.font.size).assertEqual('15.00lpx'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datepicker_selectedTextStyle_0001 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc get the default value + */ + it('ArkUI_Stage_datepicker_selectedTextStyle_0001', 0, async function (done) { + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datepicker_selectedTextStyle_0001] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF0000FF'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00px'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Bold'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datepicker_selectedTextStyle_0002 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_datepicker_selectedTextStyle_0002', 0, async function (done) { + let value = {color:Color.Blue,font:{size:'20px',weight:FontWeight.Bolder}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datepicker_selectedTextStyle_0002] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datepicker_selectedTextStyle_0002] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.error("[ArkUI_Stage_datepicker_selectedTextStyle_0002] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF0000FF'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00px'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Bolder'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datepicker_selectedTextStyle_0003 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_datepicker_selectedTextStyle_0003', 0, async function (done) { + let value = {color:0xFF808080,font:{size:'20px',weight:100}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datepicker_selectedTextStyle_0003] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datepicker_selectedTextStyle_0003] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datepicker_selectedTextStyle_0003] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF808080'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00px'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('100'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datepicker_selectedTextStyle_0004 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_datepicker_selectedTextStyle_0004', 0, async function (done) { + let value = {color:'#00ff00',font:{size:'1px',weight:'700'}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datepicker_selectedTextStyle_0004] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datepicker_selectedTextStyle_0004] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datepicker_selectedTextStyle_0004] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF00FF00'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('1.00px'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('700'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datepicker_selectedTextStyle_0005 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_datepicker_selectedTextStyle_0005', 0, async function (done) { + let value = {color:Color.Green,font:{size:30,weight:450}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datepicker_selectedTextStyle_0005] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datepicker_selectedTextStyle_0005] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datepicker_selectedTextStyle_0005] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF008000'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('30.00fp'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datepicker_selectedTextStyle_0006 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_datepicker_selectedTextStyle_0006', 0, async function (done) { + let value = {color:'#80808g',font:{size:-1,weight:1000}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datepicker_selectedTextStyle_0006] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datepicker_selectedTextStyle_0006] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_datepicker_selectedTextStyle_0006] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF007DFF'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00vp'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_datepicker_selectedTextStyle_0007 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_datepicker_selectedTextStyle_0007', 0, async function (done) { + let value = {color:'xxx',font:{size:'xxx',weight:FontWeight.Lighter}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_datepicker_selectedTextStyle_0007] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_datepicker_selectedTextStyle_0007] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0007] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF007DFF'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00vp'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Lighter'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_selectedTextStyle_0008 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_selectedTextStyle_0008', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'20vp',weight:900}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0008] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_selectedTextStyle_0008] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00vp'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('900'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_selectedTextStyle_0009 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_selectedTextStyle_0009', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'15lpx',weight:90}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 185, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0009] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_selectedTextStyle_0009] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('datePicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('15.00lpx'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + }) + } + diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/test/List.test.ets b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..eebd28f62dc2ccce3ea349988b3ad8d57a4ad452 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/test/List.test.ets @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import datepicker from './DatePicker' + +export default function testsuite() { + datepicker() + +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/test/Utils.ets b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/test/Utils.ets new file mode 100644 index 0000000000000000000000000000000000000000..6fecbfe80e6e5a3882dac77004efbc26a7faefea --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/test/Utils.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default class Utils { + static sleep(time){ + return new Promise((resolve,reject)=>{ + setTimeout(()=>{ + resolve("ok") + },time) + }).then(()=>{ + console.info(`sleep ${time} over...`) + }) + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/module.json b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..2b03fde2a1898cf911b3b3f2f94a553bca8ebb86 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/module.json @@ -0,0 +1,41 @@ +{ + "module": { + "name": "phone", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "visible": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/resources/base/element/color.json b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..65d8fa5a7cf54aa3943dcd0214f58d1771bc1f6c --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/resources/base/media/icon.png b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/resources/base/media/icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/resources/base/profile/test_pages.json b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/resources/base/profile/test_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..77e90731b5a38d861663029b483df3d3ac9ec74b --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "TestAbility/pages/Index" + ] +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/AppScope/app.json b/arkui/ace_ets_components_ux/ace_ets_component_progress/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..260b7d42058398caeb38e756037aceafe9e21452 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/AppScope/app.json @@ -0,0 +1,19 @@ +{ + "app": { + "bundleName": "com.example.progresstest", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/AppScope/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_progress/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..30af7cfee6766dda361b893d1565490dc145fdf0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"MyApplication" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_components_ux/ace_ets_component_progress/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_progress/AppScope/resources/base/media/app_icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/BUILD.gn b/arkui/ace_ets_components_ux/ace_ets_component_progress/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..0bed0101c13dcede51fdc18a86f16e48f46c8af9 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/BUILD.gn @@ -0,0 +1,43 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAceProgressTest") { + hap_profile = "src/main/module.json" + js_build_mode = "debug" + deps = [ + ":ace_ets_component_progress_js_assets", + ":ace_ets_component_progress_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsAceProgressTest" + part_name = "ace_engine" + subsystem_name = "arkui" +} + +ohos_app_scope("ace_ets_component_progress_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("ace_ets_component_progress_js_assets") { + source_dir = "src/main/ets" +} + +ohos_resources("ace_ets_component_progress_resources") { + sources = [ "src/main/resources" ] + deps = [ ":ace_ets_component_progress_profile" ] + hap_profile = "src/main/module.json" +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/Test.json b/arkui/ace_ets_components_ux/ace_ets_component_progress/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..cd350c918a0a1de92f3114bba28aee0e6630a4cf --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/Test.json @@ -0,0 +1,26 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "600000", + "bundle-name": "com.example.progresstest", + "module-name": "phone", + "shell-timeout": "600000", + "testcase-timeout": 240000 + }, + "kits": [{ + "test-file-name": [ + "ActsAceProgressTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "power-shell wakeup", + "power-shell setmode 602" + ] + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/signature/openharmony_sx.p7b b/arkui/ace_ets_components_ux/ace_ets_component_progress/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..96206d3cb05c64f302165056f5ff2e39c7446254 Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_progress/signature/openharmony_sx.p7b differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestAbility/TestAbility.ets b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestAbility/TestAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d65dd2ea8346a8b5d12ac7aff026197a95abaea --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestAbility/TestAbility.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import Ability from '@ohos.app.ability.UIAbility' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import testsuite from '../test/List.test' +import Window from '@ohos.window' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('TestAbility/pages/Index', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestAbility/pages/Index.ets b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestAbility/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..89380a74c00cec9c7e3833944a7cddc71df71a3f --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestAbility/pages/Index.ets @@ -0,0 +1,294 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + //@ts-nocheck +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import hilog from '@ohos.hilog'; +import testsuite from '../../test/List.test' +@Entry +@Component +struct progressTest { + @State progress: ProgressMask = new ProgressMask(10.0, 100.0, 0x01006CDE); + aboutToAppear(){ + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + build() { + Row() { + Column() { + List({ space: 0, initialIndex: 0 }) { + + ListItem() { + Image($r('app.media.icon')) + .key("ArkUX_Stage_Progress_updateColor") + .mask(this.progress) + .backgroundColor(Color.Pink) + .width('500px').height('280px') + } + ListItem() { + Button("updateColor_restore") + .key("ArkUX_Stage_Progress_updateColor_restore") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_restore onClick'); + this.progress.updateColor(Color.Gray); + }) + .fontSize(10) + } + ListItem() { + Row() { + Button("updateColor_0100") + .key("ArkUX_Stage_Progress_updateColor_Button_0100") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_0100 onClick'); + this.progress.updateColor(0x00ff00); + }) + .fontSize(10) + Button("updateColor_0200") + .key("ArkUX_Stage_Progress_updateColor_Button_0200") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_0200 onClick'); + this.progress.updateColor("#FFFD0000"); + }) + .fontSize(10) + Button("updateColor_0300") + .key("ArkUX_Stage_Progress_updateColor_Button_0300") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_0300 onClick'); + this.progress.updateColor("#FF8A2BE2"); + }) + .fontSize(10) + } + } + ListItem() { + Row() { + Button("updateColor_0400") + .key("ArkUX_Stage_Progress_updateColor_Button_0400") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_0400 onClick'); + this.progress.updateColor(Color.Pink); + }) + .fontSize(10) + Button("updateColor_0500") + .key("ArkUX_Stage_Progress_updateColor_Button_0500") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_0500 onClick'); + this.progress.updateColor($r("app.color.Progress_updateColor")); + }) + .fontSize(10) + Button("updateColor_0600") + .key("ArkUX_Stage_Progress_updateColor_Button_0600") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_0600 onClick'); + this.progress.updateColor(0xff006cde); + }) + .fontSize(10) + } + } + ListItem() { + Row() { + Button("updateColor_0700") + .key("ArkUX_Stage_Progress_updateColor_Button_0700") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_0700 onClick'); + this.progress.updateColor("#33006cde"); + }) + .fontSize(10) + Button("updateColor_0800") + .key("ArkUX_Stage_Progress_updateColor_Button_0800") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_0800 onClick'); + this.progress.updateColor("rgba(0,108,222,0.8)"); + }) + .fontSize(10) + Button("updateColor_0900") + .key("ArkUX_Stage_Progress_updateColor_Button_0900") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_0900 onClick'); + this.progress.updateColor($r("app.color.Progress_updateColor_transparency")); + }) + .fontSize(10) + } + } + ListItem() { + Row() { + Button("updateColor_1000") + .key("ArkUX_Stage_Progress_updateColor_Button_1000") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_1000 onClick'); + this.progress.updateColor(""); + }) + .fontSize(10) + Button("updateColor_1100") + .key("ArkUX_Stage_Progress_updateColor_Button_1100") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_1100 onClick'); + this.progress.updateColor(null); + }) + .fontSize(10) + Button("updateColor_1200") + .key("ArkUX_Stage_Progress_updateColor_Button_1200") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_1200 onClick'); + this.progress.updateColor(undefined); + }) + .fontSize(10) + } + } + ListItem() { + Row() { + Button("updateColor_1300") + .key("ArkUX_Stage_Progress_updateColor_Button_1300") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_1300 onClick'); + this.progress.updateColor('bgr(138,43,226)'); + }) + .fontSize(10) + Button("updateColor_1400") + .key("ArkUX_Stage_Progress_updateColor_Button_1400") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_1400 onClick'); + this.progress.updateColor("rgba(0,108,222,70)"); + this.progress.updateColor(Color.Pink); + }) + .fontSize(10) + Button("updateColor_1500") + .key("ArkUX_Stage_Progress_updateColor_Button_1500") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_1500 onClick'); + this.progress.updateColor("rgba(0,108,222,70)"); + this.progress.updateColor(undefined); + }) + .fontSize(10) + } + } + ListItem() { + Row() { + Button("updateColor_1600") + .key("ArkUX_Stage_Progress_updateColor_Button_1600") + .onClick((event: ClickEvent) => { + console.info('ArkUX_Stage_Progress_updateColor_Button_1600 onClick'); + this.progress.updateColor(0x00ff00); + }) + .fontSize(10) + } + } + + ListItem() { + Progress({ value: 20, total: 150, type: ProgressType.Capsule }) + .key("ArkUX_Stage_Progress_borderColor_0100") + .borderColor(0x00ff00) + .width('500px') + .height('50px') + } + ListItem() { + Progress({ value: 20, total: 150, type: ProgressType.Capsule }) + .key("ArkUX_Stage_Progress_borderColor_0200") + .borderColor('#fffd0000') + .width('500px') + .height('50px') + } + ListItem() { + Progress({ value: 20, total: 150, type: ProgressType.Capsule }) + .key("ArkUX_Stage_Progress_borderColor_0300") + .borderColor("rgb(138,43,226)") + .width('500px') + .height('50px') + } + ListItem() { + Progress({ value: 20, total: 150, type: ProgressType.Capsule }) + .key("ArkUX_Stage_Progress_borderColor_0400") + .borderColor(Color.Pink) + .width('500px') + .height('50px') + } + ListItem() { + Progress({ value: 20, total: 150, type: ProgressType.Capsule }) + .key("ArkUX_Stage_Progress_borderColor_0500") + .borderColor($r("app.color.Progress_borderColor")) + .width('500px') + .height('50px') + } + ListItem() { + Progress({ value: 20, total: 150, type: ProgressType.Capsule }) + .key("ArkUX_Stage_Progress_borderColor_0600") + .borderColor("") + .width('500px') + .height('50px') + } + ListItem() { + Progress({ value: 20, total: 150, type: ProgressType.Capsule }) + .key("ArkUX_Stage_Progress_borderColor_0700") + .borderColor(null) + .width('500px') + .height('50px') + } + ListItem() { + Progress({ value: 20, total: 150, type: ProgressType.Capsule }) + .key("ArkUX_Stage_Progress_borderColor_0800") + .borderColor(undefined) + .width('500px') + .height('50px') + } + ListItem() { + Progress({ value: 20, total: 150, type: ProgressType.Capsule }) + .key("ArkUX_Stage_Progress_borderColor_0900") + .borderColor("rgb(138,43,226)") + .borderColor("#FFFD0000") + .width('500px') + .height('50px') + } + ListItem() { + Progress({ value: 20, total: 150, type: ProgressType.Capsule }) + .key("ArkUX_Stage_Progress_borderColor_1000") + .borderColor(Color.Pink) + .borderColor("") + .width('500px') + .height('50px') + } + ListItem() { + Progress({ value: 20, total: 150, type: ProgressType.Capsule }) + .key("ArkUX_Stage_Progress_borderColor_1100") + .borderColor('bgr(138,43,226)') + .width('500px') + .height('50px') + } + ListItem() { + Progress({ value: 20, total: 150, type: ProgressType.Capsule }) + .key("ArkUX_Stage_Progress_borderColor_1200") + .borderColor(0x00ff00) + .backgroundColor(Color.Pink) + .width('500px') + .height('50px') + } + ListItem() { + Progress({ value: 20, total: 150, type: ProgressType.Capsule }) + .key("ArkUX_Stage_Progress_borderColor_1300") + .width('500px') + .height('50px') + } + } + } + .width('100%') + } + .height('100%') + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6c662824093f9339085214d247c6247faa86ae9 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s it', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${targetParams} ${key} ${parameters[key]}` + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/test/List.test.ets b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..7f6662003363ab722643b56085e802e42542c195 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import progressTest from './progress' + +export default function testsuite() { + progressTest() +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/test/progress.ets b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/test/progress.ets new file mode 100644 index 0000000000000000000000000000000000000000..8b532243130e5a13383ba4fced64681485926272 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/test/progress.ets @@ -0,0 +1,884 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' + +function sleep(time){ + return new Promise((resolve,reject)=>{ + setTimeout(()=>{ + resolve("ok") + },time) + }).then(()=>{ + console.info(`sleep ${time} over...`) + }) +} +export default function progressTest() { + describe('ActsProgressTest', function () { + + /* + *tc.number ArkUX_Stage_Progress_updateColor_0100 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to 0x00ff00 + */ + it('ArkUX_Stage_Progress_updateColor_0100', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_0100 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_0100 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_0100 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_Progress_updateColor_0100 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_0100 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_0100',10,'') + expect(result).assertEqual(true); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_updateColor_0200 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to '#fffd0000' + */ + it('ArkUX_Stage_Progress_updateColor_0200', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_0200 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_0200 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_0200 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_Progress_updateColor_0200 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_0200 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_0200',10,'') + expect(result).assertEqual(true); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_updateColor_0300 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to 'rgb(138,43,226)' + */ + it('ArkUX_Stage_Progress_updateColor_0300', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_0300 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_0300 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_0300 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#FF8A2BE2"); + console.info('ArkUX_Stage_Progress_updateColor_0300 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_0300 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_0300',10,'') + expect(result).assertEqual(true); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_updateColor_0400 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to Color.Pink + */ + it('ArkUX_Stage_Progress_updateColor_0400', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_0400 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_0400 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_0400 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#FFFFC0CB"); + console.info('ArkUX_Stage_Progress_updateColor_0400 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_0400 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_0400',10,'') + expect(result).assertEqual(true); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_updateColor_0500 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to $r("app.color.Progress_updateColor") + */ + it('ArkUX_Stage_Progress_updateColor_0500', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_0500 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_0500 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_0500 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_Progress_updateColor_0500 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_0500 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_0500',10,'') + expect(result).assertEqual(true); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_updateColor_0600 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to 0xff006cde + */ + it('ArkUX_Stage_Progress_updateColor_0600', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_0600 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_0600 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_0600 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#FF006CDE"); + console.info('ArkUX_Stage_Progress_updateColor_0600 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_0600 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_0600',10,'') + expect(result).assertEqual(true); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_updateColor_0700 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to "#33006cde" + */ + it('ArkUX_Stage_Progress_updateColor_0700', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_0700 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_0700 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_0700 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#33006CDE"); + console.info('ArkUX_Stage_Progress_updateColor_0700 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_0700 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_0700',10,'') + expect(result).assertEqual(true); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_updateColor_0800 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to "rgba(0,108,222,0.8)" + */ + it('ArkUX_Stage_Progress_updateColor_0800', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_0800 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_0800 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_0800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_0800 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#CC006CDE"); + console.info('ArkUX_Stage_Progress_updateColor_0800 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_0800 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_0800',10,'') + expect(result).assertEqual(true); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_updateColor_0900 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to $r("app.color.Progress_updateColor_transparency") + */ + it('ArkUX_Stage_Progress_updateColor_0900', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_0900 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_0900 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_0900 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_0900 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#33006CDE"); + console.info('ArkUX_Stage_Progress_updateColor_0900 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_0900 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_0900',10,'') + expect(result).assertEqual(true); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_updateColor_1000 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to an outlier "" + */ + it('ArkUX_Stage_Progress_updateColor_1000', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_1000 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_1000 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_1000 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_1000 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#99182431"); + console.info('ArkUX_Stage_Progress_updateColor_1000 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_1000 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_1000',10,'') + expect(result).assertEqual(true); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_updateColor_1100 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to an outlier null + */ + it('ArkUX_Stage_Progress_updateColor_1100', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_1100 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_1100 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_1100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_1100 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#99182431"); + console.info('ArkUX_Stage_Progress_updateColor_1100 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_1100 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_1100',10,'') + expect(result).assertEqual(true); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_updateColor_1200 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to an outlier undefined + */ + it('ArkUX_Stage_Progress_updateColor_1200', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_1200 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_1200 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_1200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_1200 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#99182431"); + console.info('ArkUX_Stage_Progress_updateColor_1200 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_1200 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_1200',10,'') + expect(result).assertEqual(true); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_updateColor_1300 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to an outlier 'bgr(138,43,226)' + */ + it('ArkUX_Stage_Progress_updateColor_1300', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_1300 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_1300 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_1300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_1300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_1300 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#99182431"); + console.info('ArkUX_Stage_Progress_updateColor_1300 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_1300 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_1300',10,'') + expect(result).assertEqual(true); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_updateColor_1400 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to "rgba(0,108,222,70)" + * and again set the updateColor property parameter to Color.Pink. + */ + it('ArkUX_Stage_Progress_updateColor_1400', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_1400 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_1400 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_1400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_1400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_1400 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#FFFFC0CB"); + console.info('ArkUX_Stage_Progress_updateColor_1400 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_1400 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_1400',10,'') + expect(result).assertEqual(true); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_updateColor_1500 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to "rgba(0,108,222,70)" + * and again set the updateColor property parameter to outlier undefined. + */ + it('ArkUX_Stage_Progress_updateColor_1500', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_1500 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_1500 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_1500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_1500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_1500 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#99182431"); + console.info('ArkUX_Stage_Progress_updateColor_1500 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_1500 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_1500',10,'') + expect(result).assertEqual(true); + },1000) + }); + + + /* + *tc.number ArkUX_Stage_Progress_updateColor_1600 + *tc.name Tests the updateColor property of the Progress component + *tc.desc Set the updateColor property parameter to 0x00ff00 + * and the universal property backgroundColor property value to Color.Pink + */ + it('ArkUX_Stage_Progress_updateColor_1600', 0, async function (done) { + console.info('ArkUX_Stage_Progress_updateColor_1600 START'); + setTimeout(async()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_updateColor'); + console.info('ArkUX_Stage_Progress_updateColor_1600 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_updateColor_1600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_updateColor_1600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_updateColor_1600 component obj.$attrs.updateColor is: " + + JSON.stringify(obj.$attrs.updateColor)); + expect(obj.$attrs.updateColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_Progress_updateColor_1600 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_updateColor_1600 ERR '+ JSON.stringify(err)); + } + done(); + },3000) + setTimeout(async()=>{ + let result = sendEventByKey('ArkUX_Stage_Progress_updateColor_Button_1600',10,'') + expect(result).assertEqual(true); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_borderColor_0100 + *tc.name Tests the borderColor property of the Progress component + *tc.desc Set the borderColor property parameter to 0x00ff00 + */ + it('ArkUX_Stage_Progress_borderColor_0100', 0, async function (done) { + console.info('ArkUX_Stage_Progress_borderColor_0100 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_borderColor_0100'); + console.info('ArkUX_Stage_Progress_borderColor_0100 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_borderColor_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_borderColor_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_borderColor_0100 component obj.$attrs.capsuleBorderColor is: " + + JSON.stringify(obj.$attrs.capsuleBorderColor)); + expect(obj.$attrs.capsuleBorderColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_Progress_borderColor_0100 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_borderColor_0100 ERR '+ JSON.stringify(err)); + } + done(); + },1000) + }); + + /* + *tc.number ArkUX_Stage_Progress_borderColor_0200 + *tc.name Tests the borderColor property of the Progress component + *tc.desc Set the borderColor property parameter to '#fffd0000' + */ + it('ArkUX_Stage_Progress_borderColor_0200', 0, async function (done) { + console.info('ArkUX_Stage_Progress_borderColor_0200 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_borderColor_0200'); + console.info('ArkUX_Stage_Progress_borderColor_0200 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_borderColor_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_borderColor_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_borderColor_0200 component obj.$attrs.capsuleBorderColor is: " + + JSON.stringify(obj.$attrs.capsuleBorderColor)); + expect(obj.$attrs.capsuleBorderColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_Progress_borderColor_0200 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_borderColor_0200 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /* + *tc.number ArkUX_Stage_Progress_borderColor_0300 + *tc.name Tests the borderColor property of the Progress component + *tc.desc Set the borderColor property parameter to 'rgb(138,43,226)' + */ + it('ArkUX_Stage_Progress_borderColor_0300', 0, async function (done) { + console.info('ArkUX_Stage_Progress_borderColor_0300 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_borderColor_0300'); + console.info('ArkUX_Stage_Progress_borderColor_0300 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_borderColor_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_borderColor_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_borderColor_0300 component obj.$attrs.capsuleBorderColor is: " + + JSON.stringify(obj.$attrs.capsuleBorderColor)); + expect(obj.$attrs.capsuleBorderColor).assertEqual("#FF8A2BE2"); + console.info('ArkUX_Stage_Progress_borderColor_0300 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_borderColor_0300 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /* + *tc.number ArkUX_Stage_Progress_borderColor_0400 + *tc.name Tests the borderColor property of the Progress component + *tc.desc Set the borderColor property parameter to Color.Pink + */ + it('ArkUX_Stage_Progress_borderColor_0400', 0, async function (done) { + console.info('ArkUX_Stage_Progress_borderColor_0400 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_borderColor_0400'); + console.info('ArkUX_Stage_Progress_borderColor_0400 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_borderColor_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_borderColor_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_borderColor_0400 component obj.$attrs.capsuleBorderColor is: " + + JSON.stringify(obj.$attrs.capsuleBorderColor)); + expect(obj.$attrs.capsuleBorderColor).assertEqual("#FFFFC0CB"); + console.info('ArkUX_Stage_Progress_borderColor_0400 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_borderColor_0400 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /* + *tc.number ArkUX_Stage_Progress_borderColor_0500 + *tc.name Tests the borderColor property of the Progress component + *tc.desc Set the borderColor property parameter to $r("app.color.Progress_Color") + */ + it('ArkUX_Stage_Progress_borderColor_0500', 0, async function (done) { + console.info('ArkUX_Stage_Progress_borderColor_0500 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_borderColor_0500'); + console.info('ArkUX_Stage_Progress_borderColor_0500 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_borderColor_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_borderColor_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_borderColor_0500 component obj.$attrs.capsuleBorderColor is: " + + JSON.stringify(obj.$attrs.capsuleBorderColor)); + expect(obj.$attrs.capsuleBorderColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_Progress_borderColor_0500 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_borderColor_0500 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /* + *tc.number ArkUX_Stage_Progress_borderColor_0600 + *tc.name Tests the borderColor property of the Progress component + *tc.desc Set the borderColor property parameter to an outlier "" + */ + it('ArkUX_Stage_Progress_borderColor_0600', 0, async function (done) { + console.info('ArkUX_Stage_Progress_borderColor_0600 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_borderColor_0600'); + console.info('ArkUX_Stage_Progress_borderColor_0600 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_borderColor_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_borderColor_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_borderColor_0600 component obj.$attrs.capsuleBorderColor is: " + + JSON.stringify(obj.$attrs.capsuleBorderColor)); + expect(obj.$attrs.capsuleBorderColor).assertEqual("#33007DFF"); + console.info('ArkUX_Stage_Progress_borderColor_0600 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_borderColor_0600 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /* + *tc.number ArkUX_Stage_Progress_borderColor_0700 + *tc.name Tests the borderColor property of the Progress component + *tc.desc Set the borderColor property parameter to an outlier null + */ + it('ArkUX_Stage_Progress_borderColor_0700', 0, async function (done) { + console.info('ArkUX_Stage_Progress_borderColor_0700 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_borderColor_0700'); + console.info('ArkUX_Stage_Progress_borderColor_0700 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_borderColor_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_borderColor_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_borderColor_0700 component obj.$attrs.capsuleBorderColor is: " + + JSON.stringify(obj.$attrs.capsuleBorderColor)); + expect(obj.$attrs.capsuleBorderColor).assertEqual("#33007DFF"); + console.info('ArkUX_Stage_Progress_borderColor_0700 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_borderColor_0700 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /* + *tc.number ArkUX_Stage_Progress_borderColor_0800 + *tc.name Tests the borderColor property of the Progress component + *tc.desc Set the borderColor property parameter to an outlier undefined + */ + it('ArkUX_Stage_Progress_borderColor_0800', 0, async function (done) { + console.info('ArkUX_Stage_Progress_borderColor_0800 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_borderColor_0800'); + console.info('ArkUX_Stage_Progress_borderColor_0800 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_borderColor_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_borderColor_0800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_borderColor_0800 component obj.$attrs.capsuleBorderColor is: " + + JSON.stringify(obj.$attrs.capsuleBorderColor)); + expect(obj.$attrs.capsuleBorderColor).assertEqual("#33007DFF"); + console.info('ArkUX_Stage_Progress_borderColor_0800 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_borderColor_0800 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /* + *tc.number ArkUX_Stage_Progress_borderColor_0900 + *tc.name Tests the borderColor property of the Progress component + *tc.desc Set the borderColor property parameter to Color.Pink + * and again set the borderColor property parameter to "#FFFD0000". + */ + it('ArkUX_Stage_Progress_borderColor_0900', 0, async function (done) { + console.info('ArkUX_Stage_Progress_borderColor_0900 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_borderColor_0900'); + console.info('ArkUX_Stage_Progress_borderColor_0900 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_borderColor_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_borderColor_0900 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_borderColor_0900 component obj.$attrs.capsuleBorderColor is: " + + JSON.stringify(obj.$attrs.capsuleBorderColor)); + expect(obj.$attrs.capsuleBorderColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_Progress_borderColor_0900 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_borderColor_0900 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /* + *tc.number ArkUX_Stage_Progress_borderColor_1000 + *tc.name Tests the borderColor property of the Progress component + *tc.desc Set the borderColor property parameter to Color.Pink + * and again set the borderColor property parameter to the outlier 'bgr(138,43,226)'. + */ + it('ArkUX_Stage_Progress_borderColor_1000', 0, async function (done) { + console.info('ArkUX_Stage_Progress_borderColor_1000 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_borderColor_1000'); + console.info('ArkUX_Stage_Progress_borderColor_1000 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_borderColor_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_borderColor_1000 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_borderColor_1000 component obj.$attrs.capsuleBorderColor is: " + + JSON.stringify(obj.$attrs.capsuleBorderColor)); + expect(obj.$attrs.capsuleBorderColor).assertEqual("#33007DFF"); + console.info('ArkUX_Stage_Progress_borderColor_1000 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_borderColor_1000 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /* + *tc.number ArkUX_Stage_Progress_borderColor_1100 + *tc.name Tests the borderColor property of the Progress component + *tc.desc Set borderColor property parameter to outlier 'bgr(138,43,226)' + */ + it('ArkUX_Stage_Progress_borderColor_1100', 0, async function (done) { + console.info('ArkUX_Stage_Progress_borderColor_1100 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_borderColor_1100'); + console.info('ArkUX_Stage_Progress_borderColor_1100 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_borderColor_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_borderColor_1100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_borderColor_1100 component obj.$attrs.capsuleBorderColor is: " + + JSON.stringify(obj.$attrs.capsuleBorderColor)); + expect(obj.$attrs.capsuleBorderColor).assertEqual("#33007DFF"); + console.info('ArkUX_Stage_Progress_borderColor_1100 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_borderColor_1100 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /* + *tc.number ArkUX_Stage_Progress_borderColor_1200 + *tc.name Tests the borderColor property of the Progress component + *tc.desc Set the borderColor property parameter to 0x00ff00 + * and the universal property backgroundColor property value to Color.Pink + */ + it('ArkUX_Stage_Progress_borderColor_1200', 0, async function (done) { + console.info('ArkUX_Stage_Progress_borderColor_1200 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_borderColor_1200'); + console.info('ArkUX_Stage_Progress_borderColor_1200 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_borderColor_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_borderColor_1200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_borderColor_1200 component obj.$attrs.capsuleBorderColor is: " + + JSON.stringify(obj.$attrs.capsuleBorderColor)); + expect(obj.$attrs.capsuleBorderColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_Progress_borderColor_1200 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_borderColor_1200 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + + /* + *tc.number ArkUX_Stage_Progress_borderColor_1300 + *tc.name Tests the borderColor property of the Progress component + *tc.desc The new attribute borderColor is not set + */ + it('ArkUX_Stage_Progress_borderColor_1300', 0, async function (done) { + console.info('ArkUX_Stage_Progress_borderColor_1300 START'); + setTimeout(()=>{ + try{ + let strJson = getInspectorByKey('ArkUX_Stage_Progress_borderColor_1300'); + console.info('ArkUX_Stage_Progress_borderColor_1300 START :'+ JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Progress_borderColor_1300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Progress_borderColor_1300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Progress_borderColor_1300 component obj.$attrs.capsuleBorderColor is: " + + JSON.stringify(obj.$attrs.capsuleBorderColor)); + expect(obj.$attrs.capsuleBorderColor).assertEqual("#33007DFF"); + console.info('ArkUX_Stage_Progress_borderColor_1300 END '); + } catch(err) { + expect().assertFail(); + console.info('ArkUX_Stage_Progress_borderColor_1300 ERR '+ JSON.stringify(err)); + } + done(); + },500) + }); + }) +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/module.json b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..2b03fde2a1898cf911b3b3f2f94a553bca8ebb86 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/module.json @@ -0,0 +1,41 @@ +{ + "module": { + "name": "phone", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "visible": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/resources/base/element/color.json b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..bae683f3d539c582cc5891a07d2d4a6b59498803 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/resources/base/element/color.json @@ -0,0 +1,20 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "Progress_borderColor", + "value": "#FFFD0000" + }, + { + "name": "Progress_updateColor", + "value": "#FFFD0000" + }, + { + "name": "Progress_updateColor_transparency", + "value": "#33006cde" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..65d8fa5a7cf54aa3943dcd0214f58d1771bc1f6c --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/resources/base/media/icon.png b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/resources/base/media/icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/resources/base/profile/test_pages.json b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/resources/base/profile/test_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..77e90731b5a38d861663029b483df3d3ac9ec74b --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "TestAbility/pages/Index" + ] +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/AppScope/app.json b/arkui/ace_ets_components_ux/ace_ets_component_radio/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..43f80bbe792cd9f77f442d78fe3e2a6229b41a5c --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_radio/AppScope/app.json @@ -0,0 +1,19 @@ +{ + "app": { + "bundleName": "com.example.radiotest", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/AppScope/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_radio/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..30af7cfee6766dda361b893d1565490dc145fdf0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_radio/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"MyApplication" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_components_ux/ace_ets_component_radio/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_radio/AppScope/resources/base/media/app_icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/BUILD.gn b/arkui/ace_ets_components_ux/ace_ets_component_radio/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..fe5a6587bdf9181243b78b8157f7eb65a3c442ca --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_radio/BUILD.gn @@ -0,0 +1,43 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAceRadioTest") { + hap_profile = "src/main/module.json" + js_build_mode = "debug" + deps = [ + ":ace_ets_component_radio_js_assets", + ":ace_ets_component_radio_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsAceRadioTest" + part_name = "ace_engine" + subsystem_name = "arkui" +} + +ohos_app_scope("ace_ets_component_radio_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("ace_ets_component_radio_js_assets") { + source_dir = "src/main/ets" +} + +ohos_resources("ace_ets_component_radio_resources") { + sources = [ "src/main/resources" ] + deps = [ ":ace_ets_component_radio_profile" ] + hap_profile = "src/main/module.json" +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/Test.json b/arkui/ace_ets_components_ux/ace_ets_component_radio/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..eef06157217d028b388e13438b3f516f375c6d29 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_radio/Test.json @@ -0,0 +1,26 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "600000", + "bundle-name": "com.example.radiotest", + "module-name": "phone", + "shell-timeout": "600000", + "testcase-timeout": 240000 + }, + "kits": [{ + "test-file-name": [ + "ActsAceRadioTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "power-shell wakeup", + "power-shell setmode 602" + ] + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/signature/openharmony_sx.p7b b/arkui/ace_ets_components_ux/ace_ets_component_radio/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..4b9c6e4d1100e29551d3cd0daeecf6ae1a768ff9 Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_radio/signature/openharmony_sx.p7b differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/TestAbility/TestAbility.ets b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/TestAbility/TestAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d65dd2ea8346a8b5d12ac7aff026197a95abaea --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/TestAbility/TestAbility.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import Ability from '@ohos.app.ability.UIAbility' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import testsuite from '../test/List.test' +import Window from '@ohos.window' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('TestAbility/pages/Index', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/TestAbility/pages/Index.ets b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/TestAbility/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..23f3f5488477cfacc8f18b37bed7c5568536dddc --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/TestAbility/pages/Index.ets @@ -0,0 +1,475 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + //@ts-nocheck +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import hilog from '@ohos.hilog'; +import testsuite from '../../test/List.test' +@Entry +@Component +struct RadioTest { + + aboutToAppear(){ + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + build() { + Row() { + Column() { + List({ space: 0, initialIndex: 0 }) { + ListItem() { + Radio({ value: 'Radio1', group: 'radioGroup' }) + .checked(true) + .width(50) + .height(50) + .radioStyle({ checkedBackgroundColor: "#FF000000" }) + .key("ArkUX_Stage_Radio_CheckedBackgroundColor_0100") + .onChange((isChecked: boolean) => { + console.log('Radio1 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio2', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ checkedBackgroundColor: 0xffc0cb }) + .key("ArkUX_Stage_Radio_CheckedBackgroundColor_0200") + .onChange((isChecked: boolean) => { + console.log('Radio2 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio3', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ checkedBackgroundColor: 'rgb(255,0,0)' }) + .key("ArkUX_Stage_Radio_CheckedBackgroundColor_0300") + .onChange((isChecked: boolean) => { + console.log('Radio3 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio4', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ checkedBackgroundColor: Color.Green }) + .key("ArkUX_Stage_Radio_CheckedBackgroundColor_0400") + .onChange((isChecked: boolean) => { + console.log('Radio4 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio5', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ checkedBackgroundColor: $r("app.color.radio_BackgroundColor") }) + .key("ArkUX_Stage_Radio_CheckedBackgroundColor_0500") + .onChange((isChecked: boolean) => { + console.log('Radio5 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio6', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ checkedBackgroundColor: "rgb(138,43,226)" }) + .radioStyle({ checkedBackgroundColor: Color.Gray }) + .key("ArkUX_Stage_Radio_CheckedBackgroundColor_0600") + .onChange((isChecked: boolean) => { + console.log('Radio6 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio7', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ checkedBackgroundColor: 0xffff00 }) + .backgroundColor(Color.Pink) + .key("ArkUX_Stage_Radio_CheckedBackgroundColor_0700") + .onChange((isChecked: boolean) => { + console.log('Radio7 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio8', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ checkedBackgroundColor: '' }) + .key("ArkUX_Stage_Radio_CheckedBackgroundColor_0800") + .onChange((isChecked: boolean) => { + console.log('Radio8 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio9', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ checkedBackgroundColor: null }) + .key("ArkUX_Stage_Radio_CheckedBackgroundColor_0900") + .onChange((isChecked: boolean) => { + console.log('Radio9 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio10', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ checkedBackgroundColor: undefined }) + .key("ArkUX_Stage_Radio_CheckedBackgroundColor_1000") + .onChange((isChecked: boolean) => { + console.log('Radio10 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio11', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ checkedBackgroundColor: "rgb(255,0,0)" }) + .radioStyle({ checkedBackgroundColor: undefined }) + .key("ArkUX_Stage_Radio_CheckedBackgroundColor_1100") + .onChange((isChecked: boolean) => { + console.log('Radio11 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio12', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ checkedBackgroundColor: 'color' }) + .key("ArkUX_Stage_Radio_CheckedBackgroundColor_1200") + .onChange((isChecked: boolean) => { + console.log('Radio12 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio13', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ uncheckedBorderColor: "#FF00FF00" }) + .key("ArkUX_Stage_Radio_UncheckedBorderColor_0100") + .onChange((isChecked: boolean) => { + console.log('Radio13 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio14', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ uncheckedBorderColor: 0xffc0cb }) + .key("ArkUX_Stage_Radio_UncheckedBorderColor_0200") + .onChange((isChecked: boolean) => { + console.log('Radio14 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio15', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ uncheckedBorderColor: 'rgb(255,255,0)' }) + .key("ArkUX_Stage_Radio_UncheckedBorderColor_0300") + .onChange((isChecked: boolean) => { + console.log('Radio15 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio16', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ uncheckedBorderColor: Color.Blue }) + .key("ArkUX_Stage_Radio_UncheckedBorderColor_0400") + .onChange((isChecked: boolean) => { + console.log('Radio16 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio17', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ uncheckedBorderColor: $r("app.color.radio_UnBorderColor") }) + .key("ArkUX_Stage_Radio_UncheckedBorderColor_0500") + .onChange((isChecked: boolean) => { + console.log('Radio17 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio18', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ uncheckedBorderColor: "rgb(138,43,226)" }) + .radioStyle({ uncheckedBorderColor: Color.Black }) + .key("ArkUX_Stage_Radio_UncheckedBorderColor_0600") + .onChange((isChecked: boolean) => { + console.log('Radio18 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio19', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ uncheckedBorderColor: 0xffa500 }) + .backgroundColor(Color.Pink) + .key("ArkUX_Stage_Radio_UncheckedBorderColor_0700") + .onChange((isChecked: boolean) => { + console.log('Radio19 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio20', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ uncheckedBorderColor: '' }) + .key("ArkUX_Stage_Radio_UncheckedBorderColor_0800") + .onChange((isChecked: boolean) => { + console.log('Radio20 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio21', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ uncheckedBorderColor: null }) + .key("ArkUX_Stage_Radio_UncheckedBorderColor_0900") + .onChange((isChecked: boolean) => { + console.log('Radio21 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio22', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ uncheckedBorderColor: undefined }) + .key("ArkUX_Stage_Radio_UncheckedBorderColor_1000") + .onChange((isChecked: boolean) => { + console.log('Radio22 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio23', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ uncheckedBorderColor: "rgb(255,0,0)" }) + .radioStyle({ uncheckedBorderColor: undefined }) + .key("ArkUX_Stage_Radio_UncheckedBorderColor_1100") + .onChange((isChecked: boolean) => { + console.log('Radio23 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio24', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ uncheckedBorderColor: 'bgr(138,43,226)' }) + .key("ArkUX_Stage_Radio_UncheckedBorderColor_1200") + .onChange((isChecked: boolean) => { + console.log('Radio24 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio25', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ indicatorColor: "#FF00FFFF" }) + .key("ArkUX_Stage_Radio_IndicatorColor_0100") + .onChange((isChecked: boolean) => { + console.log('Radio25 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio26', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ indicatorColor: 0xffc0cb }) + .key("ArkUX_Stage_Radio_IndicatorColor_0200") + .onChange((isChecked: boolean) => { + console.log('Radio26 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio27', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ indicatorColor: 'rgb(255,97,0)' }) + .key("ArkUX_Stage_Radio_IndicatorColor_0300") + .onChange((isChecked: boolean) => { + console.log('Radio27 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio28', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ indicatorColor: Color.Yellow }) + .key("ArkUX_Stage_Radio_IndicatorColor_0400") + .onChange((isChecked: boolean) => { + console.log('Radio28 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio29', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ indicatorColor: $r("app.color.radio_IndicatorColor") }) + .key("ArkUX_Stage_Radio_IndicatorColor_0500") + .onChange((isChecked: boolean) => { + console.log('Radio29 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio30', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ indicatorColor: "rgb(138,43,226)" }) + .radioStyle({ indicatorColor: Color.Black }) + .key("ArkUX_Stage_Radio_IndicatorColor_0600") + .onChange((isChecked: boolean) => { + console.log('Radio30 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio31', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ indicatorColor: 0xffa500 }) + .backgroundColor(Color.Pink) + .key("ArkUX_Stage_Radio_IndicatorColor_0700") + .onChange((isChecked: boolean) => { + console.log('Radio31 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio32', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ indicatorColor: '' }) + .key("ArkUX_Stage_Radio_IndicatorColor_0800") + .onChange((isChecked: boolean) => { + console.log('Radio32 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio33', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ indicatorColor: null }) + .key("ArkUX_Stage_Radio_IndicatorColor_0900") + .onChange((isChecked: boolean) => { + console.log('Radio33 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio34', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ indicatorColor: undefined }) + .key("ArkUX_Stage_Radio_IndicatorColor_1000") + .onChange((isChecked: boolean) => { + console.log('Radio34 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio35', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ indicatorColor: "rgb(138,43,226)" }) + .radioStyle({ indicatorColor: undefined }) + .key("ArkUX_Stage_Radio_IndicatorColor_1100") + .onChange((isChecked: boolean) => { + console.log('Radio35 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio36', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ indicatorColor: 'bgr(138,43,226)' }) + .key("ArkUX_Stage_Radio_IndicatorColor_1200") + .onChange((isChecked: boolean) => { + console.log('Radio36 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio37', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .radioStyle({ + checkedBackgroundColor: "#FFFF0000", + uncheckedBorderColor: "#FFDB70DB", + indicatorColor: "#FFFFFF00" + }) + .key("ArkUX_Stage_Radio_Color_0100") + .onChange((isChecked: boolean) => { + console.log('Radio37 status is' + isChecked) + }) + } + ListItem() { + Radio({ value: 'Radio38', group: 'radioGroup' }) + .checked(false) + .width(50) + .height(50) + .key("ArkUX_Stage_Radio_0100") + .onChange((isChecked: boolean) => { + console.log('Radio38 status is' + isChecked) + }) + } + } + } + .width('100%') + } + .height('100%') +} +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6c662824093f9339085214d247c6247faa86ae9 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s it', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${targetParams} ${key} ${parameters[key]}` + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/test/List.test.ets b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..744a711ef9ef936acdf884dbc55113c3b15640ba --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import radioTest from './radio' + +export default function testsuite() { + radioTest() +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/test/radio.ets b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/test/radio.ets new file mode 100644 index 0000000000000000000000000000000000000000..51b29acc477fc022b8e8491c766a90087cb77a54 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/test/radio.ets @@ -0,0 +1,1203 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// @ts-nocheck +import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' +let emitKey = "emitUserAgent"; +export default function radioTest() { + describe('ActsRadioTest', function () { + + /** + * @tc.number ArkUX_Stage_Radio_CheckedBackgroundColor_0100 + * @tc.name Tests the checkedBackgroundColor property of the radio component + * @tc.desc Radio common components, set checkedBackgroundColor property parameter to "#FF000000" + */ + it('ArkUX_Stage_Radio_CheckedBackgroundColor_0100', 0, async function (done) { + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_CheckedBackgroundColor_0100'); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0100 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0100 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.checkedBackgroundColor).assertEqual("#FF000000"); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_CheckedBackgroundColor_0200 + * @tc.name Tests the checkedBackgroundColor property of the radio component + * @tc.desc Radio common components, set checkedBackgroundColor property parameter to 0xffc0cb + */ + it('ArkUX_Stage_Radio_CheckedBackgroundColor_0200', 0, async function (done) { + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_CheckedBackgroundColor_0200'); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0200 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0200 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.checkedBackgroundColor).assertEqual("#FFFFC0CB"); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_CheckedBackgroundColor_0300 + * @tc.name Tests the checkedBackgroundColor property of the radio component + * @tc.desc Radio common components, set checkedBackgroundColor property parameter to 'rgb(255,0,0)' + */ + it('ArkUX_Stage_Radio_CheckedBackgroundColor_0300', 0, async function (done) { + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_CheckedBackgroundColor_0300'); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0300 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0300 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.checkedBackgroundColor).assertEqual("#FFFF0000"); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_CheckedBackgroundColor_0400 + * @tc.name Tests the checkedBackgroundColor property of the radio component + * @tc.desc Radio common components, set checkedBackgroundColor property parameter to Color.Green + */ + it('ArkUX_Stage_Radio_CheckedBackgroundColor_0400', 0, async function (done) { + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_CheckedBackgroundColor_0400'); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0400 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0400 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.checkedBackgroundColor).assertEqual("#FF008000"); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_CheckedBackgroundColor_0500 + * @tc.name Tests the checkedBackgroundColor property of the radio component + * @tc.desc Radio common components, set checkedBackgroundColor property parameter to + * $r("app.color.radio_BackgroundColor") + */ + it('ArkUX_Stage_Radio_CheckedBackgroundColor_0500', 0, async function (done) { + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_CheckedBackgroundColor_0500'); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0500 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0500 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.checkedBackgroundColor).assertEqual("#FFA67D3D"); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_CheckedBackgroundColor_0600 + * @tc.name Tests the checkedBackgroundColor property of the radio component + * @tc.desc Radio common components, set checkedBackgroundColor property parameter to "rgb(138,43,226)", + * and set the checkedBackgroundColor parameter to Color.Gray + */ + it('ArkUX_Stage_Radio_CheckedBackgroundColor_0600', 0, async function (done) { + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_CheckedBackgroundColor_0600'); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0600 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0600 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.checkedBackgroundColor).assertEqual("#FF808080"); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_CheckedBackgroundColor_0700 + * @tc.name Tests the checkedBackgroundColor property of the radio component + * @tc.desc Radio common components, set checkedBackgroundColor property parameter to 0x00ff00, + * set the general attribute backgroundColor parameter to Color.Pink + */ + it('ArkUX_Stage_Radio_CheckedBackgroundColor_0700', 0, async function (done) { + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_CheckedBackgroundColor_0700'); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0700 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0700 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.checkedBackgroundColor).assertEqual("#FFFFFF00"); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_CheckedBackgroundColor_0800 + * @tc.name Tests the checkedBackgroundColor property of the radio component + * @tc.desc Radio common components, set checkedBackgroundColor property parameter to '' + */ + it('ArkUX_Stage_Radio_CheckedBackgroundColor_0800', 0, async function (done) { + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_CheckedBackgroundColor_0800'); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0800 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0800 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.checkedBackgroundColor).assertEqual("#FF007DFF"); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_CheckedBackgroundColor_0900 + * @tc.name Tests the checkedBackgroundColor property of the radio component + * @tc.desc Radio common components, set checkedBackgroundColor property parameter to null + */ + it('ArkUX_Stage_Radio_CheckedBackgroundColor_0900', 0, async function (done) { + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_CheckedBackgroundColor_0900'); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0900 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0900 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_0900 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.checkedBackgroundColor).assertEqual("#FF007DFF"); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0900 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0900 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_CheckedBackgroundColor_1000 + * @tc.name Tests the checkedBackgroundColor property of the radio component + * @tc.desc Radio common components, set checkedBackgroundColor property parameter to undefined + */ + it('ArkUX_Stage_Radio_CheckedBackgroundColor_1000', 0, async function (done) { + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_CheckedBackgroundColor_1000'); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_1000 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_1000 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_1000 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.checkedBackgroundColor).assertEqual("#FF007DFF"); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_1000 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_0700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_CheckedBackgroundColor_1100 + * @tc.name Tests the checkedBackgroundColor property of the radio component + * @tc.desc Radio common components, set checkedBackgroundColor property parameter to "rgb(138,43,226)", + * and set the checkedBackgroundColor parameter to undefined + */ + it('ArkUX_Stage_Radio_CheckedBackgroundColor_1100', 0, async function (done) { + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_CheckedBackgroundColor_1100'); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_1100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_1100 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_1100 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.checkedBackgroundColor).assertEqual("#FF007DFF"); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_1100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_1100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_CheckedBackgroundColor_1200 + * @tc.name Tests the checkedBackgroundColor property of the radio component + * @tc.desc Radio common components, set checkedBackgroundColor property parameter to 'bgr(138,43,226)' + */ + it('ArkUX_Stage_Radio_CheckedBackgroundColor_1200', 0, async function (done) { + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_CheckedBackgroundColor_1200'); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_1200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_1200 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_CheckedBackgroundColor_1200 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.checkedBackgroundColor).assertEqual("#FF007DFF"); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_1200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_CheckedBackgroundColor_1200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_UncheckedBorderColor_0100 + * @tc.name Tests the uncheckedBorderColor property of the radio component + * @tc.desc Radio common components, set uncheckedBorderColor property parameter to "#FF00FF00" + */ + it('ArkUX_Stage_Radio_UncheckedBorderColor_0100', 0, async function (done) { + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_UncheckedBorderColor_0100'); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0100 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0100 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.uncheckedBorderColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_UncheckedBorderColor_0200 + * @tc.name Tests the uncheckedBorderColor property of the radio component + * @tc.desc Radio common components, set uncheckedBorderColor property parameter to 0xffc0cb + */ + it('ArkUX_Stage_Radio_UncheckedBorderColor_0200', 0, async function (done) { + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_UncheckedBorderColor_0200'); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0200 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0200 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.uncheckedBorderColor).assertEqual("#FFFFC0CB"); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_UncheckedBorderColor_0300 + * @tc.name Tests the uncheckedBorderColor property of the radio component + * @tc.desc Radio common components, set uncheckedBorderColor property parameter to 'rgb(255,255,0)' + */ + it('ArkUX_Stage_Radio_UncheckedBorderColor_0300', 0, async function (done) { + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_UncheckedBorderColor_0300'); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0300 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0300 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.uncheckedBorderColor).assertEqual("#FFFFFF00"); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_UncheckedBorderColor_0400 + * @tc.name Tests the uncheckedBorderColor property of the radio component + * @tc.desc Radio common components, set uncheckedBorderColor property parameter to Color.Blue + */ + it('ArkUX_Stage_Radio_UncheckedBorderColor_0400', 0, async function (done) { + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_UncheckedBorderColor_0400'); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0400 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0400 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.uncheckedBorderColor).assertEqual("#FF0000FF"); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_UncheckedBorderColor_0500 + * @tc.name Tests the uncheckedBorderColor property of the radio component + * @tc.desc Radio common components, set uncheckedBorderColor property parameter to + * $r("app.color.radio_UnBorderColor") + */ + it('ArkUX_Stage_Radio_UncheckedBorderColor_0500', 0, async function (done) { + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_UncheckedBorderColor_0500'); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0500 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0500 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.uncheckedBorderColor).assertEqual("#FFFF0000"); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_UncheckedBorderColor_0600 + * @tc.name Tests the uncheckedBorderColor property of the radio component + * @tc.desc Radio common components, set uncheckedBorderColor property parameter to "rgb(138,43,226)" + * and set the uncheckedBorderColor parameter to Color.Black + */ + it('ArkUX_Stage_Radio_UncheckedBorderColor_0600', 0, async function (done) { + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_UncheckedBorderColor_0600'); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0600 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0600 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.uncheckedBorderColor).assertEqual("#FF000000"); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_UncheckedBorderColor_0700 + * @tc.name Tests the checkedBackgroundColor property of the radio component + * @tc.desc Radio common components, set checkedBackgroundColor property parameter to 0xffa500, + * set the general attribute backgroundColor parameter to Color.Pink + */ + it('ArkUX_Stage_Radio_UncheckedBorderColor_0700', 0, async function (done) { + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_UncheckedBorderColor_0700'); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0700 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0700 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.uncheckedBorderColor).assertEqual("#FFFFA500"); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_UncheckedBorderColor_0800 + * @tc.name Tests the uncheckedBorderColor property of the radio component + * @tc.desc Radio common components, set uncheckedBorderColor property parameter to '' + */ + it('ArkUX_Stage_Radio_UncheckedBorderColor_0800', 0, async function (done) { + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_UncheckedBorderColor_0800'); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0800 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0800 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.uncheckedBorderColor).assertEqual("#66182431"); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_UncheckedBorderColor_0900 + * @tc.name Tests the uncheckedBorderColor property of the radio component + * @tc.desc Radio common components, set uncheckedBorderColor property parameter to null + */ + it('ArkUX_Stage_Radio_UncheckedBorderColor_0900', 0, async function (done) { + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_UncheckedBorderColor_0900'); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0900 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0900 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_0900 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.uncheckedBorderColor).assertEqual("#66182431"); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0900 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_0900 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_UncheckedBorderColor_1000 + * @tc.name Tests the uncheckedBorderColor property of the radio component + * @tc.desc Radio common components, set uncheckedBorderColor property parameter to undefined + */ + it('ArkUX_Stage_Radio_UncheckedBorderColor_1000', 0, async function (done) { + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_UncheckedBorderColor_1000'); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_1000 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_1000 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_1000 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.uncheckedBorderColor).assertEqual("#66182431"); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_1000 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_1000 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_UncheckedBorderColor_1100 + * @tc.name Tests the uncheckedBorderColor property of the radio component + * @tc.desc Radio common components, set uncheckedBorderColor property parameter to "rgb(138,43,226)", + * and set the uncheckedBorderColor parameter to undefined + */ + it('ArkUX_Stage_Radio_UncheckedBorderColor_1100', 0, async function (done) { + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_UncheckedBorderColor_1100'); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_1100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_1100 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_1100 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.uncheckedBorderColor).assertEqual("#66182431"); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_1100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_1100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_UncheckedBorderColor_1200 + * @tc.name Tests the uncheckedBorderColor property of the radio component + * @tc.desc Radio common components, set uncheckedBorderColor property parameter to 'bgr(138,43,226)' + */ + it('ArkUX_Stage_Radio_UncheckedBorderColor_1200', 0, async function (done) { + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_UncheckedBorderColor_1200'); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_1200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_1200 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_UncheckedBorderColor_1200 component radioStyle is: " + + JSON.stringify(radioStyle)); + expect(radioStyle.uncheckedBorderColor).assertEqual("#66182431"); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_1200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_UncheckedBorderColor_1200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_IndicatorColor_0100 + * @tc.name Tests the indicatorColor property of the radio component + * @tc.desc Radio common components, set indicatorColor property parameter to "#FF00FFFF" + */ + it('ArkUX_Stage_Radio_IndicatorColor_0100', 0, async function (done) { + console.info('ArkUX_Stage_Radio_IndicatorColor_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_IndicatorColor_0100'); + console.info('ArkUX_Stage_Radio_IndicatorColor_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_IndicatorColor_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0100 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_IndicatorColor_0100 component radioStyle is: " + JSON.stringify(radioStyle)); + expect(radioStyle.indicatorColor).assertEqual("#FF00FFFF"); + console.info('ArkUX_Stage_Radio_IndicatorColor_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_IndicatorColor_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_IndicatorColor_0200 + * @tc.name Tests the indicatorColor property of the radio component + * @tc.desc Radio common components, set indicatorColor property parameter to 0xffc0cb + */ + it('ArkUX_Stage_Radio_IndicatorColor_0200', 0, async function (done) { + console.info('ArkUX_Stage_Radio_IndicatorColor_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_IndicatorColor_0200'); + console.info('ArkUX_Stage_Radio_IndicatorColor_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_IndicatorColor_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0200 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_IndicatorColor_0200 component radioStyle is: " + JSON.stringify(radioStyle)); + expect(radioStyle.indicatorColor).assertEqual("#FFFFC0CB"); + console.info('ArkUX_Stage_Radio_IndicatorColor_0200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_IndicatorColor_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_IndicatorColor_0300 + * @tc.name Tests the indicatorColor property of the radio component + * @tc.desc Radio common components, set indicatorColor property parameter to 'rgb(255,97,0)' + */ + it('ArkUX_Stage_Radio_IndicatorColor_0300', 0, async function (done) { + console.info('ArkUX_Stage_Radio_IndicatorColor_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_IndicatorColor_0300'); + console.info('ArkUX_Stage_Radio_IndicatorColor_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_IndicatorColor_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0300 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_IndicatorColor_0300 component radioStyle is: " + JSON.stringify(radioStyle)); + expect(radioStyle.indicatorColor).assertEqual("#FFFF6100"); + console.info('ArkUX_Stage_Radio_IndicatorColor_0300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_IndicatorColor_0300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_IndicatorColor_0400 + * @tc.name Tests the indicatorColor property of the radio component + * @tc.desc Radio common components, set indicatorColor property parameter to Color.Yellow + */ + it('ArkUX_Stage_Radio_IndicatorColor_0400', 0, async function (done) { + console.info('ArkUX_Stage_Radio_IndicatorColor_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_IndicatorColor_0400'); + console.info('ArkUX_Stage_Radio_IndicatorColor_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_IndicatorColor_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0400 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_IndicatorColor_0400 component radioStyle is: " + JSON.stringify(radioStyle)); + expect(radioStyle.indicatorColor).assertEqual("#FFFFFF00"); + console.info('ArkUX_Stage_Radio_IndicatorColor_0400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_IndicatorColor_0400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_IndicatorColor_0500 + * @tc.name Tests the indicatorColor property of the radio component + * @tc.desc Radio common components, set indicatorColor property parameter to + * $r("app.color.radio_IndicatorColor") + */ + it('ArkUX_Stage_Radio_IndicatorColor_0500', 0, async function (done) { + console.info('ArkUX_Stage_Radio_IndicatorColor_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_IndicatorColor_0500'); + console.info('ArkUX_Stage_Radio_IndicatorColor_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_IndicatorColor_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0500 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_IndicatorColor_0500 component radioStyle is: " + JSON.stringify(radioStyle)); + expect(radioStyle.indicatorColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_Radio_IndicatorColor_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_IndicatorColor_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_IndicatorColor_0600 + * @tc.name Tests the indicatorColor property of the radio component + * @tc.desc Radio common components, set indicatorColor property parameter to "rgb(138,43,226)", + * and set the indicatorColor parameter to Color.Black + */ + it('ArkUX_Stage_Radio_IndicatorColor_0600', 0, async function (done) { + console.info('ArkUX_Stage_Radio_IndicatorColor_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_IndicatorColor_0600'); + console.info('ArkUX_Stage_Radio_IndicatorColor_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_IndicatorColor_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0600 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_IndicatorColor_0600 component radioStyle is: " + JSON.stringify(radioStyle)); + expect(radioStyle.indicatorColor).assertEqual("#FF000000"); + console.info('ArkUX_Stage_Radio_IndicatorColor_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_IndicatorColor_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_IndicatorColor_0700 + * @tc.name Tests the indicatorColor property of the radio component + * @tc.desc Radio common components, set indicatorColor property parameter to "rgb(138,43,226)", + * set the general attribute backgroundColor parameter to Color.Pink + */ + it('ArkUX_Stage_Radio_IndicatorColor_0700', 0, async function (done) { + console.info('ArkUX_Stage_Radio_IndicatorColor_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_IndicatorColor_0700'); + console.info('ArkUX_Stage_Radio_IndicatorColor_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_IndicatorColor_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0700 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_IndicatorColor_0700 component radioStyle is: " + JSON.stringify(radioStyle)); + expect(radioStyle.indicatorColor).assertEqual("#FFFFA500"); + console.info('ArkUX_Stage_Radio_IndicatorColor_0700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_IndicatorColor_0700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_IndicatorColor_0800 + * @tc.name Tests the indicatorColor property of the radio component + * @tc.desc Radio common components, set indicatorColor property parameter to '' + */ + it('ArkUX_Stage_Radio_IndicatorColor_0800', 0, async function (done) { + console.info('ArkUX_Stage_Radio_IndicatorColor_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_IndicatorColor_0800'); + console.info('ArkUX_Stage_Radio_IndicatorColor_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_IndicatorColor_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0800 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_IndicatorColor_0800 component radioStyle is: " + JSON.stringify(radioStyle)); + expect(radioStyle.indicatorColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_Radio_IndicatorColor_0800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_IndicatorColor_0800 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_IndicatorColor_0900 + * @tc.name Tests the indicatorColor property of the radio component + * @tc.desc Radio common components, set indicatorColor property parameter to null + */ + it('ArkUX_Stage_Radio_IndicatorColor_0900', 0, async function (done) { + console.info('ArkUX_Stage_Radio_IndicatorColor_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_IndicatorColor_0900'); + console.info('ArkUX_Stage_Radio_IndicatorColor_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_IndicatorColor_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0900 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_IndicatorColor_0900 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_IndicatorColor_0900 component radioStyle is: " + JSON.stringify(radioStyle)); + expect(radioStyle.indicatorColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_Radio_IndicatorColor_0900 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_IndicatorColor_0900 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_IndicatorColor_1000 + * @tc.name Tests the indicatorColor property of the radio component + * @tc.desc Radio common components, set indicatorColor property parameter to undefined + */ + it('ArkUX_Stage_Radio_IndicatorColor_1000', 0, async function (done) { + console.info('ArkUX_Stage_Radio_IndicatorColor_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_IndicatorColor_1000'); + console.info('ArkUX_Stage_Radio_IndicatorColor_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_IndicatorColor_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_IndicatorColor_1000 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_IndicatorColor_1000 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_IndicatorColor_1000 component radioStyle is: " + JSON.stringify(radioStyle)); + expect(radioStyle.indicatorColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_Radio_IndicatorColor_1000 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_IndicatorColor_1000 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_IndicatorColor_1100 + * @tc.name Tests the indicatorColor property of the radio component + * @tc.desc Radio common components, set indicatorColor property parameter to "rgb(138,43,226)", + * and set the indicatorColor parameter to undefined + */ + it('ArkUX_Stage_Radio_IndicatorColor_1100', 0, async function (done) { + console.info('ArkUX_Stage_Radio_IndicatorColor_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_IndicatorColor_1100'); + console.info('ArkUX_Stage_Radio_IndicatorColor_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_IndicatorColor_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_IndicatorColor_1100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_IndicatorColor_1100 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_IndicatorColor_1100 component radioStyle is: " + JSON.stringify(radioStyle)); + expect(radioStyle.indicatorColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_Radio_IndicatorColor_1100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_IndicatorColor_1100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_IndicatorColor_1200 + * @tc.name Tests the indicatorColor property of the radio component + * @tc.desc Radio common components, set indicatorColor property parameter to 'bgr(138,43,226)' + */ + it('ArkUX_Stage_Radio_IndicatorColor_1200', 0, async function (done) { + console.info('ArkUX_Stage_Radio_IndicatorColor_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_IndicatorColor_1200'); + console.info('ArkUX_Stage_Radio_IndicatorColor_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_IndicatorColor_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_IndicatorColor_1200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_IndicatorColor_1200 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_IndicatorColor_1200 component radioStyle is: " + JSON.stringify(radioStyle)); + expect(radioStyle.indicatorColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_Radio_IndicatorColor_1200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_IndicatorColor_1200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_Color_0100 + * @tc.name Test all new attribute property of the radio component + * @tc.desc Radio common components, set checkedBackgroundColor property parameter to "#FFFF0000" + * set uncheckedBorderColor property parameter to "#FFDB70DB" + * set indicatorColor property parameter to "#FFFFFF00" + */ + it('ArkUX_Stage_Radio_Color_0100', 0, async function (done) { + console.info('ArkUX_Stage_Radio_Color_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_Color_0100'); + console.info('ArkUX_Stage_Radio_Color_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_Color_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_Color_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_Color_0100 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_Color_0100 component radioStyle is: " + JSON.stringify(radioStyle)); + expect(radioStyle.checkedBackgroundColor).assertEqual("#FFFF0000"); + expect(radioStyle.uncheckedBorderColor).assertEqual("#FFDB70DB"); + expect(radioStyle.indicatorColor).assertEqual("#FFFFFF00"); + console.info('ArkUX_Stage_Radio_Color_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_Color_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Radio_Color_0100 + * @tc.name The test did not set the new attribute of the radio component + * @tc.desc The new attribute of radio component is not set, View the default value + */ + it('ArkUX_Stage_Radio_0100', 0, async function (done) { + console.info('ArkUX_Stage_Radio_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Radio_0100'); + console.info('ArkUX_Stage_Radio_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Radio_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Radio_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Radio_0100 component obj.$attrs.radioStyle is: " + + JSON.stringify(obj.$attrs.radioStyle)); + let radioStyle = JSON.parse(obj.$attrs.radioStyle); + console.info("ArkUX_Stage_Radio_0100 component radioStyle is: " + JSON.stringify(radioStyle)); + expect(radioStyle.checkedBackgroundColor).assertEqual("#FF007DFF"); + expect(radioStyle.uncheckedBorderColor).assertEqual("#66182431"); + expect(radioStyle.indicatorColor).assertEqual("#FFFFFFFF"); + console.info('ArkUX_Stage_Radio_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Radio_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + }) +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/module.json b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..2b03fde2a1898cf911b3b3f2f94a553bca8ebb86 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/module.json @@ -0,0 +1,41 @@ +{ + "module": { + "name": "phone", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "visible": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/resources/base/element/color.json b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..04bd3b7ac263cdccbc7a6711d7ed4bab51cea220 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/resources/base/element/color.json @@ -0,0 +1,20 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "radio_BackgroundColor", + "value": "#FFA67D3D" + }, + { + "name": "radio_UnBorderColor", + "value": "#FFFF0000" + }, + { + "name": "radio_IndicatorColor", + "value": "#FF00FF00" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c91ea0a919a12a554b7181f95d94e15bee08df7a --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + }, + { + "name": "Divider_width", + "value": "10px" + }, + { + "name": "Divider_startMargin", + "value": "5px" + }, + { + "name": "Divider_endMargin", + "value": "5px" + }, + { + "name": "Check_Mark_Size_test", + "value": "50" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/resources/base/media/icon.png b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/resources/base/media/icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/resources/base/profile/test_pages.json b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/resources/base/profile/test_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..77e90731b5a38d861663029b483df3d3ac9ec74b --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "TestAbility/pages/Index" + ] +} diff --git a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/AppScope/app.json b/arkui/ace_ets_components_ux/ace_ets_component_swiper/AppScope/app.json old mode 100755 new mode 100644 similarity index 59% rename from ability/ability_runtime/non_concurrent/actsthirdapponerelytest/AppScope/app.json rename to arkui/ace_ets_components_ux/ace_ets_component_swiper/AppScope/app.json index ef625aa89907c897c893344c03a9a64e08033a93..17a999ff4e3653d03a40c0e8641dd2af8d138332 --- a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/AppScope/app.json +++ b/arkui/ace_ets_components_ux/ace_ets_component_swiper/AppScope/app.json @@ -1,19 +1,19 @@ -{ - "app": { - "bundleName": "com.example.actsthirdappuonehundredone", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } +{ + "app": { + "bundleName": "com.example.swipertest", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } } \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/AppScope/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_swiper/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 59% rename from ability/ability_runtime/non_concurrent/actsthirdapponerelytest/AppScope/resources/base/element/string.json rename to arkui/ace_ets_components_ux/ace_ets_component_swiper/AppScope/resources/base/element/string.json index be09cccde1bc7369ef47a5cd45d2b06884c88602..3e8dda342484af625ea003b67a3db2d55bedcab9 --- a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/AppScope/resources/base/element/string.json +++ b/arkui/ace_ets_components_ux/ace_ets_component_swiper/AppScope/resources/base/element/string.json @@ -1,8 +1,8 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} +{ + "string": [ + { + "name": "app_name", + "value": "MyApplication" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_swiper/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_components_ux/ace_ets_component_swiper/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_swiper/AppScope/resources/base/media/app_icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_swiper/BUILD.gn b/arkui/ace_ets_components_ux/ace_ets_component_swiper/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..d759697abfa0bd9b5b21ce39a755068c746c5896 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_swiper/BUILD.gn @@ -0,0 +1,43 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAceSwiperTest") { + hap_profile = "src/main/module.json" + js_build_mode = "debug" + deps = [ + ":ace_ets_component_swiper_js_assets", + ":ace_ets_component_swiper_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsAceSwiperTest" + part_name = "ace_engine" + subsystem_name = "arkui" +} + +ohos_app_scope("ace_ets_component_swiper_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("ace_ets_component_swiper_js_assets") { + source_dir = "src/main/ets" +} + +ohos_resources("ace_ets_component_swiper_resources") { + sources = [ "src/main/resources" ] + deps = [ ":ace_ets_component_swiper_profile" ] + hap_profile = "src/main/module.json" +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_swiper/Test.json b/arkui/ace_ets_components_ux/ace_ets_component_swiper/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..fc890e93e349bc3f72b0b6a622364e2152c257ab --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_swiper/Test.json @@ -0,0 +1,27 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "600000", + "bundle-name": "com.example.swipertest", + "module-name": "phone", + "shell-timeout": "600000", + "testcase-timeout": 240000 + }, + "kits": [ + { + "test-file-name": [ + "ActsAceSwiperTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "power-shell wakeup", + "power-shell setmode 602" + ] + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_swiper/signature/openharmony_sx.p7b b/arkui/ace_ets_components_ux/ace_ets_component_swiper/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..931b0f0377aa2aab87bb2a89f4ff1d52d0c9ff7c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_swiper/signature/openharmony_sx.p7b differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/TestAbility/TestAbility.ets b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/TestAbility/TestAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d65dd2ea8346a8b5d12ac7aff026197a95abaea --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/TestAbility/TestAbility.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import Ability from '@ohos.app.ability.UIAbility' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import testsuite from '../test/List.test' +import Window from '@ohos.window' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('TestAbility/pages/Index', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/TestAbility/pages/Index.ets b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/TestAbility/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..ec3b27f47d74a792cbedb436476ad308e212baed --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/TestAbility/pages/Index.ets @@ -0,0 +1,1098 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + //@ts-nocheck +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import hilog from '@ohos.hilog'; +import testsuite from '../../test/List.test' + +export class MyDataSource implements IDataSource { + private list: number[] = [] + private listener: DataChangeListener + + constructor(list: number[]) { this.list = list } + + totalCount(): number { + return this.list.length +} + + getData(index: number): any { + return this.list[index] + } + + registerDataChangeListener(listener: DataChangeListener): void { + this.listener = listener + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct SwiperTest { + + aboutToAppear(){ + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + @State flag: boolean = false; + @State selectedItemWidth: number = 12 + @State selectedItemHeight: number = 6 + @State itemWidth: number = 6 + @State itemHeight: number = 6 + @State selectedFontColor: Color = Color.Black + @State fontColor: Color = Color.Black + @State selectedSize: string | number = 14; + @State itemSize: string | number = 14; + @State selectedWeight: FontWeight | number | string = FontWeight.Normal; + @State itemWeight: FontWeight | number | string = FontWeight.Normal; + private swiperController: SwiperController = new SwiperController() + private data: MyDataSource = new MyDataSource([]) + + build() { + Row() { + Column() { + List({ space: 5, initialIndex: 0 }) { + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemWidth_0100") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemWidth(5)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemWidth_0200") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemWidth("")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemWidth_0300") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemWidth("9999vp")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemWidth_0400") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemWidth(-1)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemWidth_0500") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemWidth("abc")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemWidth_0600") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemWidth(0)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemWidth_0700") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemWidth("8fp")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemWidth_0800") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemWidth("8lpx")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemHeight_0100") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemHeight(3)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemHeight_0200") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemHeight("")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemHeight_0300") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemHeight("9999fp")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemHeight_0400") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemHeight(-1)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemHeight_0500") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemHeight("abc")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemHeight_0600") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemHeight(0)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemHeight_0700") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemHeight("8vp")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedItemHeight_0800") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .selectedItemHeight("8lpx")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_ItemWidth_0100") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .itemWidth(3)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_ItemWidth_0200") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .itemWidth("")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_ItemWidth_0300") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .itemWidth("9999lpx")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_ItemWidth_0400") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .itemWidth(-1)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_ItemWidth_0500") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .itemWidth("abc")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_ItemWidth_0600") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .itemWidth("8px")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_ItemWidth_0700") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .itemWidth("8fp")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_ItemHeight_0100") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .itemHeight(3)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_ItemHeight_0200") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .itemHeight("")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_ItemHeight_0300") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .itemHeight("9999vp")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_ItemHeight_0400") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .itemHeight(-1)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_ItemHeight_0500") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .itemHeight("abc")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_ItemHeight_0600") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .itemHeight("8fp")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_ItemHeight_0700") + .curve(Curve.Linear) + .indicator(Indicator.dot() + .itemHeight("8lpx")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedFontColor_0100") + .curve(Curve.Linear) + .indicator(Indicator.digit() + .selectedFontColor(0x00ff00)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedFontColor_0200") + .curve(Curve.Linear) + .indicator(Indicator.digit() + .selectedFontColor("#FFFF0000")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedFontColor_0300") + .curve(Curve.Linear) + .indicator(Indicator.digit() + .selectedFontColor("rgb(138,43,226)")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedFontColor_0400") + .curve(Curve.Linear) + .indicator(Indicator.digit() + .selectedFontColor(Color.Pink)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedFontColor_0500") + .curve(Curve.Linear) + .indicator(Indicator.digit() + .selectedFontColor("")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedFontColor_0600") + .curve(Curve.Linear) + .indicator(Indicator.digit() + .selectedFontColor(null)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedFontColor_0700") + .curve(Curve.Linear) + .indicator(Indicator.digit() + .selectedFontColor($r("app.color.selected_font_color_test"))) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedFontColor_0800") + .curve(Curve.Linear) + .indicator(Indicator.digit() + .selectedFontColor("bgr(138,43,226)")) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedFontColor_0900") + .curve(Curve.Linear) + .indicator(Indicator.digit() + .selectedFontColor(undefined)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedFontColor_1000") + .curve(Curve.Linear) + .indicator(Indicator.digit() + .selectedFontColor("rgb(138,43,226)")) + .indicator(Indicator.digit() + .selectedFontColor(Color.Gray)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedFontColor_1100") + .curve(Curve.Linear) + .indicator(Indicator.digit() + .selectedFontColor(0x00ff00)) + .backgroundColor(Color.Pink) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, item => item) + } + .autoPlay(true) + .interval(4000) + .loop(true) + .duration(1000) + .itemSpace(0) + .key("ArkUX_Stage_Swiper_SelectedFontColor_1200") + .curve(Curve.Linear) + .indicator(Indicator.digit() + .selectedFontColor("rgb(255,0,0)")) + .indicator(Indicator.digit() + .selectedFontColor(undefined)) + .onChange((index: number) => { + console.info(index.toString()) + }) + } + } + } + .width('100%') + } + .height('100%') + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6c662824093f9339085214d247c6247faa86ae9 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s it', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${targetParams} ${key} ${parameters[key]}` + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/test/List.test.ets b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..1615575e03b1bfaa1dba29fc019e73e0f43499fa --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import swiperTest from './swiper' + +export default function testsuite() { + swiperTest() +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/test/swiper.ets b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/test/swiper.ets new file mode 100644 index 0000000000000000000000000000000000000000..d8dc5fb409bb981fd6366b34c939b4159dc56f36 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/test/swiper.ets @@ -0,0 +1,1288 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// @ts-nocheck +import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' +import hilog from '@ohos.hilog'; + +let emitKey = "emitUserAgent"; + +export default function swiperTest() { + describe('ActSwiperTest', function () { + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemWidth_0100 + * @tc.name Tests the selectedItemWidth property of the swiper component + * @tc.desc set the selectedItemWidth property parameter to 5 + */ + it('ArkUX_Stage_Swiper_SelectedItemWidth_0100', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemWidth_0100'); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0100 component obj.$attrs.selectedItemWidth is: " + + JSON.stringify(obj.$attrs.selectedItemWidth)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0100 component obj2 is: " + JSON.stringify(obj2.selectedItemWidth)); + expect(obj2.selectedItemWidth).assertEqual("5.00px"); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemWidth_0200 + * @tc.name Tests the selectedItemWidth property of the swiper component + * @tc.desc Set the selectedItemWidth property parameter to "" + */ + it('ArkUX_Stage_Swiper_SelectedItemWidth_0200', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemWidth_0200'); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0200 component obj.$attrs.selectedItemWidth is: " + + JSON.stringify(obj.$attrs.selectedItemWidth)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0200 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedItemWidth).assertEqual("6.00vp"); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemWidth_0300 + * @tc.name Tests the selectedItemWidth property of the swiper component + * @tc.desc Set the selectedItemWidth property parameter to "9999vp" + */ + it('ArkUX_Stage_Swiper_SelectedItemWidth_0300', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemWidth_0300'); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0300 component obj.$attrs.selectedItemWidth is: " + + JSON.stringify(obj.$attrs.selectedItemWidth)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0300 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedItemWidth).assertEqual("9999.00vp"); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemWidth_0400 + * @tc.name Tests the selectedItemWidth property of the swiper component + * @tc.desc Set the selectedItemWidth property parameter to -1 + */ + it('ArkUX_Stage_Swiper_SelectedItemWidth_0400', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemWidth_0400'); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0400 component obj.$attrs.selectedItemWidth is: " + + JSON.stringify(obj.$attrs.selectedItemWidth)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0400 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedItemWidth).assertEqual("6.00vp"); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemWidth_0500 + * @tc.name Tests the selectedItemWidth property of the swiper component + * @tc.desc Set the selectedItemWidth property parameter to "abc" + */ + it('ArkUX_Stage_Swiper_SelectedItemWidth_0500', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemWidth_0500'); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0500 component obj.$attrs.selectedItemWidth is: " + + JSON.stringify(obj.$attrs.selectedItemWidth)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0500 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedItemWidth).assertEqual("6.00vp"); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemWidth_0600 + * @tc.name Tests the selectedItemWidth property of the swiper component + * @tc.desc Set the selectedItemWidth property parameter to 0 + */ + it('ArkUX_Stage_Swiper_SelectedItemWidth_0600', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemWidth_0600'); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0600 component obj.$attrs.selectedItemWidth is: " + + JSON.stringify(obj.$attrs.selectedItemWidth)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0600 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedItemWidth).assertEqual("6.00vp"); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemWidth_0700 + * @tc.name Tests the selectedItemWidth property of the swiper component + * @tc.desc Set the selectedItemWidth property parameter to "8fp" + */ + it('ArkUX_Stage_Swiper_SelectedItemWidth_0700', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemWidth_0700'); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0700 component obj.$attrs.selectedItemWidth is: " + + JSON.stringify(obj.$attrs.selectedItemWidth)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0700 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedItemWidth).assertEqual("8.00fp"); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemWidth_0800 + * @tc.name Tests the selectedItemWidth property of the swiper component + * @tc.desc Set the selectedItemWidth property parameter to "8lpx" + */ + it('ArkUX_Stage_Swiper_SelectedItemWidth_0800', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemWidth_0800'); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0800 component obj.$attrs.selectedItemWidth is: " + + JSON.stringify(obj.$attrs.selectedItemWidth)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemWidth_0800 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedItemWidth).assertEqual("8.00lpx"); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemWidth_0800 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemHeight_0100 + * @tc.name Tests the selectedItemHeight property of the swiper component + * @tc.desc Set the selectedItemHeight property parameter to 3 + */ + it('ArkUX_Stage_Swiper_SelectedItemHeight_0100', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemHeight_0100'); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0100 component obj.$attrs.selectedItemHeight is: " + + JSON.stringify(obj.$attrs.selectedItemHeight)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0100 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedItemHeight).assertEqual("3.00px"); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemHeight_0200 + * @tc.name Tests the selectedItemHeight property of the swiper component + * @tc.desc Set the selectedItemHeight property parameter to "" + */ + it('ArkUX_Stage_Swiper_SelectedItemHeight_0200', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemHeight_0200'); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0200 component obj.$attrs.selectedItemHeight is: " + + JSON.stringify(obj.$attrs.selectedItemHeight)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0200 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedItemHeight).assertEqual("6.00vp"); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemHeight_0300 + * @tc.name Tests the selectedItemHeight property of the swiper component + * @tc.desc Set the selectedItemHeight property parameter to "9999fp" + */ + it('ArkUX_Stage_Swiper_SelectedItemHeight_0300', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemHeight_0300'); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0300 component obj.$attrs.selectedItemHeight is: " + + JSON.stringify(obj.$attrs.selectedItemHeight)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0300 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedItemHeight).assertEqual("9999.00fp"); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemHeight_0400 + * @tc.name Tests the selectedItemHeight property of the swiper component + * @tc.desc Set the selectedItemHeight property parameter to -1 + */ + it('ArkUX_Stage_Swiper_SelectedItemHeight_0400', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemHeight_0400'); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0400 component obj.$attrs.selectedItemHeight is: " + + JSON.stringify(obj.$attrs.selectedItemHeight)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0400 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedItemHeight).assertEqual("6.00vp"); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemHeight_0500 + * @tc.name Tests the selectedItemHeight property of the swiper component + * @tc.desc Set the selectedItemHeight property parameter to "abc" + */ + it('ArkUX_Stage_Swiper_SelectedItemHeight_0500', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemHeight_0500'); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0500 component obj.$attrs.selectedItemHeight is: " + + JSON.stringify(obj.$attrs.selectedItemHeight)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0500 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedItemHeight).assertEqual("6.00vp"); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemHeight_0600 + * @tc.name Tests the selectedItemHeight property of the swiper component + * @tc.desc Set the selectedItemHeight property parameter to 0 + */ + it('ArkUX_Stage_Swiper_SelectedItemHeight_0600', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemHeight_0600'); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0600 component obj.$attrs.selectedItemHeight is: " + + JSON.stringify(obj.$attrs.selectedItemHeight)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0600 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedItemHeight).assertEqual("6.00vp"); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemHeight_0700 + * @tc.name Tests the selectedItemHeight property of the swiper component + * @tc.desc Set the selectedItemHeight property parameter to "8vp" + */ + it('ArkUX_Stage_Swiper_SelectedItemHeight_0700', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemHeight_0700'); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0700 component obj.$attrs.selectedItemHeight is: " + + JSON.stringify(obj.$attrs.selectedItemHeight)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0700 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedItemHeight).assertEqual("8.00vp"); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedItemHeight_0800 + * @tc.name Tests the selectedItemHeight property of the swiper component + * @tc.desc Set the selectedItemHeight property parameter to "8lpx" + */ + it('ArkUX_Stage_Swiper_SelectedItemHeight_0800', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedItemHeight_0800'); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0800 component obj.$attrs.selectedItemHeight is: " + + JSON.stringify(obj.$attrs.selectedItemHeight)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedItemHeight_0800 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedItemHeight).assertEqual("8.00lpx"); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedItemHeight_0800 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_ItemWidth_0100 + * @tc.name Tests the itemWidth property of the swiper component + * @tc.desc Set the itemWidth property parameter to 3 + */ + it('ArkUX_Stage_Swiper_ItemWidth_0100', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_ItemWidth_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_ItemWidth_0100'); + console.info('ArkUX_Stage_Swiper_ItemWidth_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_ItemWidth_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_ItemWidth_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_ItemWidth_0100 component obj.$attrs.itemWidth is: " + + JSON.stringify(obj.$attrs.itemWidth)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_ItemWidth_0100 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.itemWidth).assertEqual("3.00px"); + console.info('ArkUX_Stage_Swiper_ItemWidth_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_ItemWidth_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_ItemWidth_0200 + * @tc.name Tests the itemWidth property of the swiper component + * @tc.desc Set the itemWidth property parameter to "" + */ + it('ArkUX_Stage_Swiper_ItemWidth_0200', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_ItemWidth_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_ItemWidth_0200'); + console.info('ArkUX_Stage_Swiper_ItemWidth_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_ItemWidth_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_ItemWidth_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_ItemWidth_0200 component obj.$attrs.itemWidth is: " + + JSON.stringify(obj.$attrs.itemWidth)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_ItemWidth_0100 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.itemWidth).assertEqual("6.00vp"); + console.info('ArkUX_Stage_Swiper_ItemWidth_0200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_ItemWidth_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_ItemWidth_0300 + * @tc.name Tests the itemWidth property of the swiper component + * @tc.desc Set the itemWidth property parameter to "9999lpx" + */ + it('ArkUX_Stage_Swiper_ItemWidth_0300', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_ItemWidth_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_ItemWidth_0300'); + console.info('ArkUX_Stage_Swiper_ItemWidth_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_ItemWidth_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_ItemWidth_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_ItemWidth_0300 component obj.$attrs.itemWidth is: " + + JSON.stringify(obj.$attrs.itemWidth)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_ItemWidth_0300 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.itemWidth).assertEqual("9999.00lpx"); + console.info('ArkUX_Stage_Swiper_ItemWidth_0300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_ItemWidth_0300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_ItemWidth_0400 + * @tc.name Tests the itemWidth property of the swiper component + * @tc.desc Set the itemWidth property parameter to -1 + */ + it('ArkUX_Stage_Swiper_ItemWidth_0400', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_ItemWidth_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_ItemWidth_0400'); + console.info('ArkUX_Stage_Swiper_ItemWidth_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_ItemWidth_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_ItemWidth_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_ItemWidth_0400 component obj.$attrs.itemWidth is: " + + JSON.stringify(obj.$attrs.itemWidth)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_ItemWidth_0400 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.itemWidth).assertEqual("6.00vp"); + console.info('ArkUX_Stage_Swiper_ItemWidth_0400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_ItemWidth_0400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_ItemWidth_0500 + * @tc.name Tests the itemWidth property of the swiper component + * @tc.desc Set the itemWidth property parameter to "abc" + */ + it('ArkUX_Stage_Swiper_ItemWidth_0500', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_ItemWidth_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_ItemWidth_0500'); + console.info('ArkUX_Stage_Swiper_ItemWidth_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_ItemWidth_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_ItemWidth_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_ItemWidth_0500 component obj.$attrs.itemWidth is: " + + JSON.stringify(obj.$attrs.itemWidth)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_ItemWidth_0500 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.itemWidth).assertEqual("6.00vp"); + console.info('ArkUX_Stage_Swiper_ItemWidth_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_ItemWidth_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_ItemWidth_0600 + * @tc.name Tests the itemWidth property of the swiper component + * @tc.desc Set the itemWidth property parameter to "8px" + */ + it('ArkUX_Stage_Swiper_ItemWidth_0600', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_ItemWidth_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_ItemWidth_0600'); + console.info('ArkUX_Stage_Swiper_ItemWidth_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_ItemWidth_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_ItemWidth_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_ItemWidth_0600 component obj.$attrs.itemWidth is: " + + JSON.stringify(obj.$attrs.itemWidth)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_ItemWidth_0600 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.itemWidth).assertEqual("8.00px"); + console.info('ArkUX_Stage_Swiper_ItemWidth_0600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_ItemWidth_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_ItemWidth_0700 + * @tc.name Tests the itemWidth property of the swiper component + * @tc.desc Set the itemWidth property parameter to "8fp" + */ + it('ArkUX_Stage_Swiper_ItemWidth_0700', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_ItemWidth_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_ItemWidth_0700'); + console.info('ArkUX_Stage_Swiper_ItemWidth_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_ItemWidth_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_ItemWidth_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_ItemWidth_0700 component obj.$attrs.itemWidth is: " + + JSON.stringify(obj.$attrs.itemWidth)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_ItemWidth_0700 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.itemWidth).assertEqual("8.00fp"); + console.info('ArkUX_Stage_Swiper_ItemWidth_0700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_ItemWidth_0700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_ItemHeight_0100 + * @tc.name Tests the itemHeight property of the swiper component + * @tc.desc Set the itemHeight property parameter to 3 + */ + it('ArkUX_Stage_Swiper_ItemHeight_0100', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_ItemHeight_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_ItemHeight_0100'); + console.info('ArkUX_Stage_Swiper_ItemHeight_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_ItemHeight_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_ItemHeight_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_ItemHeight_0100 component obj.$attrs.itemHeight is: " + + JSON.stringify(obj.$attrs.itemHeight)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_ItemHeight_0100 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.itemHeight).assertEqual("3.00px"); + console.info('ArkUX_Stage_Swiper_ItemHeight_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_ItemHeight_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_ItemHeight_0200 + * @tc.name Tests the itemHeight property of the swiper component + * @tc.desc Set the itemHeight property parameter to "" + */ + it('ArkUX_Stage_Swiper_ItemHeight_0200', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_ItemHeight_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_ItemHeight_0200'); + console.info('ArkUX_Stage_Swiper_ItemHeight_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_ItemHeight_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_ItemHeight_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_ItemHeight_0200 component obj.$attrs.itemHeight is: " + + JSON.stringify(obj.$attrs.itemHeight)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_ItemHeight_0200 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.itemHeight).assertEqual("6.00vp"); + console.info('ArkUX_Stage_Swiper_ItemHeight_0200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_ItemHeight_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_ItemHeight_0300 + * @tc.name Tests the itemHeight property of the swiper component + * @tc.desc Set the itemHeight property parameter to "9999vp" + */ + it('ArkUX_Stage_Swiper_ItemHeight_0300', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_ItemHeight_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_ItemHeight_0300'); + console.info('ArkUX_Stage_Swiper_ItemHeight_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_ItemHeight_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_ItemHeight_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_ItemHeight_0300 component obj.$attrs.itemHeight is: " + + JSON.stringify(obj.$attrs.itemHeight)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_ItemHeight_0300 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.itemHeight).assertEqual("9999.00vp"); + console.info('ArkUX_Stage_Swiper_ItemHeight_0300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_ItemHeight_0300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_ItemHeight_0400 + * @tc.name Tests the itemHeight property of the swiper component + * @tc.desc Set the itemHeight property parameter to -1 + */ + it('ArkUX_Stage_Swiper_ItemHeight_0400', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_ItemHeight_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_ItemHeight_0400'); + console.info('ArkUX_Stage_Swiper_ItemHeight_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_ItemHeight_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_ItemHeight_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_ItemHeight_0400 component obj.$attrs.itemHeight is: " + + JSON.stringify(obj.$attrs.itemHeight)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_ItemHeight_0400 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.itemHeight).assertEqual("6.00vp"); + console.info('ArkUX_Stage_Swiper_ItemHeight_0400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_ItemHeight_0400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_ItemHeight_0500 + * @tc.name Tests the itemHeight property of the swiper component + * @tc.desc Set the itemHeight property parameter to "abc" + */ + it('ArkUX_Stage_Swiper_ItemHeight_0500', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_ItemHeight_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_ItemHeight_0500'); + console.info('ArkUX_Stage_Swiper_ItemHeight_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_ItemHeight_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_ItemHeight_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_ItemHeight_0500 component obj.$attrs.itemHeight is: " + + JSON.stringify(obj.$attrs.itemHeight)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_ItemHeight_0500 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.itemHeight).assertEqual("6.00vp"); + console.info('ArkUX_Stage_Swiper_ItemHeight_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_ItemHeight_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_ItemHeight_0600 + * @tc.name Tests the itemHeight property of the swiper component + * @tc.desc Set the itemHeight property parameter to "8fp" + */ + it('ArkUX_Stage_Swiper_ItemHeight_0600', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_ItemHeight_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_ItemHeight_0600'); + console.info('ArkUX_Stage_Swiper_ItemHeight_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_ItemHeight_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_ItemHeight_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_ItemHeight_0600 component obj.$attrs.itemHeight is: " + + JSON.stringify(obj.$attrs.itemHeight)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_ItemHeight_0600 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.itemHeight).assertEqual("8.00fp"); + console.info('ArkUX_Stage_Swiper_ItemHeight_0600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_ItemHeight_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_ItemHeight_0700 + * @tc.name Tests the itemHeight property of the swiper component + * @tc.desc Set the itemHeight property parameter to "8lpx" + */ + it('ArkUX_Stage_Swiper_ItemHeight_0700', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_ItemHeight_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_ItemHeight_0700'); + console.info('ArkUX_Stage_Swiper_ItemHeight_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_ItemHeight_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_ItemHeight_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_ItemHeight_0700 component obj.$attrs.itemHeight is: " + + JSON.stringify(obj.$attrs.itemHeight)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_ItemHeight_0700 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.itemHeight).assertEqual("8.00lpx"); + console.info('ArkUX_Stage_Swiper_ItemHeight_0700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_ItemHeight_0700 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedFontColor_0100 + * @tc.name Tests the selectedFontColor property of the swiper component + * @tc.desc Set the selectedFontColor property parameter to 0x00ff00 + */ + it('ArkUX_Stage_Swiper_SelectedFontColor_0100', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedFontColor_0100'); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0100 component obj.$attrs.selectedFontColor is: " + + JSON.stringify(obj.$attrs.selectedFontColor)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0100 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedFontColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedFontColor_0200 + * @tc.name Tests the selectedFontColor property of the swiper component + * @tc.desc Set the selectedFontColor property parameter to "#FFFF0000" + */ + it('ArkUX_Stage_Swiper_SelectedFontColor_0200', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedFontColor_0200'); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0200 component obj.$attrs.selectedFontColor is: " + + JSON.stringify(obj.$attrs.selectedFontColor)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0200 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedFontColor).assertEqual("#FFFF0000"); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedFontColor_0300 + * @tc.name Tests the selectedFontColor property of the swiper component + * @tc.desc Set the selectedFontColor property parameter to "rgb(138,43,226)" + */ + it('ArkUX_Stage_Swiper_SelectedFontColor_0300', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedFontColor_0300'); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0300 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0300 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0300 component obj.$attrs.selectedFontColor is: " + + JSON.stringify(obj.$attrs.selectedFontColor)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0300 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedFontColor).assertEqual("#FF8A2BE2"); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0300 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0300 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedFontColor_0400 + * @tc.name Tests the selectedFontColor property of the swiper component + * @tc.desc Set the selectedFontColor property parameter to Color.Pink + */ + it('ArkUX_Stage_Swiper_SelectedFontColor_0400', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedFontColor_0400'); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0400 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0400 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0400 component obj.$attrs.selectedFontColor is: " + + JSON.stringify(obj.$attrs.selectedFontColor)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0400 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedFontColor).assertEqual("#FFFFC0CB"); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0400 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0400 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedFontColor_0500 + * @tc.name Tests the selectedFontColor property of the swiper component + * @tc.desc Set the selectedFontColor property parameter to "" + */ + it('ArkUX_Stage_Swiper_SelectedFontColor_0500', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedFontColor_0500'); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0500 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0500 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0500 component obj.$attrs.selectedFontColor is: " + + JSON.stringify(obj.$attrs.selectedFontColor)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0500 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedFontColor).assertEqual("#FF182431"); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0500 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0500 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedFontColor_0600 + * @tc.name Tests the selectedFontColor property of the swiper component + * @tc.desc Set the selectedFontColor property parameter to null + */ + it('ArkUX_Stage_Swiper_SelectedFontColor_0600', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedFontColor_0600'); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0600 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0600 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0600 component obj.$attrs.selectedFontColor is: " + + JSON.stringify(obj.$attrs.selectedFontColor)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0600 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedFontColor).assertEqual("#FF182431"); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0600 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0600 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedFontColor_0700 + * @tc.name Tests the selectedFontColor property of the swiper component + * @tc.desc Set the selectedFontColor property parameter to $r("app.color.selected_font_color_test") + */ + it('ArkUX_Stage_Swiper_SelectedFontColor_0700', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedFontColor_0700'); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0700 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0700 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0700 component obj.$attrs.selectedFontColor is: " + + JSON.stringify(obj.$attrs.selectedFontColor)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0700 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedFontColor).assertEqual("#FFFF0000"); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0700 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0700 ERR ' + JSON.stringify(err)); + done(); + } + done(); + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedFontColor_0800 + * @tc.name Tests the selectedFontColor property of the swiper component + * @tc.desc Set the selectedFontColor property parameter to "bgr(138,43,226)" + */ + it('ArkUX_Stage_Swiper_SelectedFontColor_0800', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedFontColor_0800'); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0800 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0800 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0800 component obj.$attrs.selectedFontColor is: " + + JSON.stringify(obj.$attrs.selectedFontColor)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0800 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedFontColor).assertEqual("#FF182431"); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0800 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0800 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedFontColor_0900 + * @tc.name Tests the selectedFontColor property of the swiper component + * @tc.desc Set the selectedFontColor property parameter to undefined + */ + it('ArkUX_Stage_Swiper_SelectedFontColor_0900', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedFontColor_0600'); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0900 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0900 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0900 component obj.$attrs.selectedFontColor is: " + + JSON.stringify(obj.$attrs.selectedFontColor)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_0900 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedFontColor).assertEqual("#FF182431"); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0900 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_0900 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedFontColor_1000 + * @tc.name Tests the selectedFontColor property of the swiper component + * @tc.desc Set the selectedFontColor attribute parameter to "rgb (138,43,226)", + * and set the selectedFontColor attribute parameter to the normal value Color.Gray again + */ + it('ArkUX_Stage_Swiper_SelectedFontColor_1000', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedFontColor_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedFontColor_1000'); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_1000 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_1000 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_1000 component obj.$attrs.selectedFontColor is: " + + JSON.stringify(obj.$attrs.selectedFontColor)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_1000 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedFontColor).assertEqual("#FF808080"); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_1000 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_1000 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedFontColor_1100 + * @tc.name Tests the selectedFontColor property of the swiper component + * @tc.desc Set the selectedFontColor property parameter to 0x00ff00, + * and set the general property backgroundColor parameter to Color.Pink + */ + it('ArkUX_Stage_Swiper_SelectedFontColor_1100', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedFontColor_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedFontColor_1100'); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_1100 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_1100 component obj.$attrs.selectedFontColor is: " + + JSON.stringify(obj.$attrs.selectedFontColor)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_1100 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedFontColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_1100 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_1100 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + + /** + * @tc.number ArkUX_Stage_Swiper_SelectedFontColor_1200 + * @tc.name Tests the selectedFontColor property of the swiper component + * @tc.desc Set the selectedFontColor property parameter to "rgb (255,0,0)", + * and set the selectedFontColor property parameter to the outlier undefined again + */ + it('ArkUX_Stage_Swiper_SelectedFontColor_1200', 0, async function (done) { + console.info('ArkUX_Stage_Swiper_SelectedFontColor_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Swiper_SelectedFontColor_1200'); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_1200 component obj.$attrs is: " + + JSON.stringify(obj.$attrs)); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_1200 component obj.$attrs.selectedFontColor is: " + + JSON.stringify(obj.$attrs.selectedFontColor)); + let obj2 = JSON.parse(obj.$attrs.indicator); + console.info("ArkUX_Stage_Swiper_SelectedFontColor_1200 component obj2 is: " + JSON.stringify(obj2)); + expect(obj2.selectedFontColor).assertEqual("#FF182431"); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_1200 END '); + done(); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_Swiper_SelectedFontColor_1200 ERR ' + JSON.stringify(err)); + done(); + } + }, 500) + }); + }) +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/module.json b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..fd47168641b845c0b3543fb2f2bbd4c5172f3cf7 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/module.json @@ -0,0 +1,43 @@ +{ + "module": { + "name": "phone", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "visible": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/resources/base/element/color.json b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..1424d008fca75b7cee2e29b27382b857bf3d636a --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/resources/base/element/color.json @@ -0,0 +1,16 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "selected_font_color_test", + "value": "#FFFF0000" + }, + { + "name": "font_color_test", + "value": "#FFFF0000" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..65d8fa5a7cf54aa3943dcd0214f58d1771bc1f6c --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/resources/base/media/icon.png b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/resources/base/media/icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/resources/base/profile/test_pages.json b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/resources/base/profile/test_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..9896fb184f3db11f1ed9c3b073fa044ffc170e26 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "TestAbility/pages/Index" + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_tabs/src/main/ets/test/Tabs.ets b/arkui/ace_ets_components_ux/ace_ets_component_tabs/src/main/ets/test/Tabs.ets index 8c1b820408eb6b402c352a248ca90982af63932a..56fd0ad37ad3d2d11b43a776e0137fb4a621e243 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_tabs/src/main/ets/test/Tabs.ets +++ b/arkui/ace_ets_components_ux/ace_ets_component_tabs/src/main/ets/test/Tabs.ets @@ -78,7 +78,6 @@ export default function tabs() { done(); }) - /** * @tc.number ArkUI_Tabs_Divider_0100 * @tc.name Tests the divier property of the tabs component @@ -506,5 +505,1256 @@ export default function tabs() { expect(dividerObject.endMargin).assertEqual('10.00lpx'); done(); }); + + /** + * @tc.number ArkUI_Tabs_LabelStyle_0100 + * @tc.name Tests the labelStyle default + * @tc.desc the default labelStyle parameter is true + */ + it('ArkUI_Tabs_LabelStyle_0100', 0, async function (done) { + console.info("ArkUI_Tabs_LabelStyle_0100 start"); + let strJson = getInspectorByKey('indicatorTest5'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_LabelStyle_0100] labelStyle:" + obj.$attrs.tabBar.labelStyle); + + expect(obj.$attrs.tabBar.labelStyle.overflow).assertEqual('TextOverflow.Ellipsis'); + expect(obj.$attrs.tabBar.labelStyle.maxLines).assertEqual('1'); + expect(obj.$attrs.tabBar.labelStyle.heightAdaptivePolicy).assertEqual('TextHeightAdaptivePolicy.MAX_LINES_FIRST'); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_LabelStyle_0200 + * @tc.name Tests the labelStyle when single line truncation with ellipsis + * @tc.desc set labelStyle to Single line truncation with ellipsis + */ + it('ArkUI_Tabs_LabelStyle_0200', 0, async function (done) { + console.info("ArkUI_Tabs_LabelStyle_0200 start"); + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_LabelStyle_0200] labelStyle:" + obj.$attrs.tabBar.labelStyle); + console.info("[ArkUI_Tabs_LabelStyle_0200] labelStyle:" + obj.$attrs.tabBar.labelStyle.font); + + expect(obj.$attrs.tabBar.labelStyle.overflow).assertEqual('TextOverflow.Ellipsis'); + expect(obj.$attrs.tabBar.labelStyle.maxLines).assertEqual('1'); + expect(obj.$attrs.tabBar.labelStyle.minFontSize).assertEqual('5.00fp'); + expect(obj.$attrs.tabBar.labelStyle.heightAdaptivePolicy).assertEqual('TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST'); + expect(obj.$attrs.tabBar.labelStyle.font.size).assertEqual('15.00fp'); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_LabelStyle_0300 + * @tc.name Tests the labelStyle when Reduce and then truncate + * @tc.desc set labelStyle to Reduce and then truncate + */ + it('ArkUI_Tabs_LabelStyle_0300', 0, async function (done) { + console.info("ArkUI_Tabs_LabelStyle_0300 start"); + await Utils.sleep(2000); + let strJson = getInspectorByKey('indicatorTest2'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_LabelStyle_0300] labelStyle:" + obj.$attrs.tabBar.labelStyle); + expect(obj.$attrs.tabBar.labelStyle.overflow).assertEqual('TextOverflow.Clip'); + expect(obj.$attrs.tabBar.labelStyle.maxLines).assertEqual('1'); + expect(obj.$attrs.tabBar.labelStyle.minFontSize).assertEqual('5.00fp'); + expect(obj.$attrs.tabBar.labelStyle.maxFontSize).assertEqual('20.00fp'); + expect(obj.$attrs.tabBar.labelStyle.heightAdaptivePolicy).assertEqual('TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST'); + expect(obj.$attrs.tabBar.labelStyle.font.size).assertEqual('15.00fp'); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_LabelStyle_0400 + * @tc.name Tests the labelStyle when shrink, wrap, and truncate + * @tc.desc set labelStyle to shrink, wrap, and truncate + */ + it('ArkUI_Tabs_LabelStyle_0400', 0, async function (done) { + console.info("ArkUI_Tabs_LabelStyle_0400 start"); + + let strJson = getInspectorByKey('indicatorTest3'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_LabelStyle_0400] labelStyle:" + obj.$attrs.tabBar.labelStyle); + expect(obj.$attrs.tabBar.labelStyle.overflow).assertEqual('TextOverflow.None'); + expect(obj.$attrs.tabBar.labelStyle.maxLines).assertEqual('2'); + expect(obj.$attrs.tabBar.labelStyle.minFontSize).assertEqual('5.00fp'); + expect(obj.$attrs.tabBar.labelStyle.maxFontSize).assertEqual('20.00fp'); + expect(obj.$attrs.tabBar.labelStyle.heightAdaptivePolicy).assertEqual('TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST'); + expect(obj.$attrs.tabBar.labelStyle.font.size).assertEqual('15.00fp'); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_LabelStyle_0500 + * @tc.name Tests the labelStyle when line feed + * @tc.desc set labelStyle to line feed + */ + it('ArkUI_Tabs_LabelStyle_0400', 0, async function (done) { + console.info("ArkUI_Tabs_LabelStyle_0400 start"); + + let strJson = getInspectorByKey('indicatorTest4'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_LabelStyle_0400] labelStyle:" + obj.$attrs.tabBar.labelStyle); + expect(obj.$attrs.tabBar.labelStyle.overflow).assertEqual('TextOverflow.None'); + expect(obj.$attrs.tabBar.labelStyle.maxLines).assertEqual('10'); + expect(obj.$attrs.tabBar.labelStyle.minFontSize).assertEqual('5.00fp'); + expect(obj.$attrs.tabBar.labelStyle.maxFontSize).assertEqual('20.00fp'); + expect(obj.$attrs.tabBar.labelStyle.heightAdaptivePolicy).assertEqual('TextHeightAdaptivePolicy.MAX_LINES_FIRST'); + expect(obj.$attrs.tabBar.labelStyle.font.size).assertEqual('15.00fp'); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_FadingEdge_0100 + * @tc.name Tests the fadingEdge property of the tabs component + * @tc.desc the default fadingEdge parameter is true + */ + it('ArkUI_Tabs_FadingEdge_0100', 0, async function (done) { + console.info("ArkUI_Tabs_FadingEdge_0100 start"); + let strJson = getInspectorByKey('tabsTest2'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_FadingEdge_0100] fadingEdge:" + obj.$attrs.fadingEdge); + expect(obj.$attrs.fadingEdge).assertEqual('true'); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_FadingEdge_0200 + * @tc.name Tests the fadingEdge property of the tabs component + * @tc.desc set fadingEdge to true + */ + it('ArkUI_Tabs_FadingEdge_0200', 0, async function (done) { + console.info("ArkUI_Tabs_FadingEdge_0200 start"); + + try { + var eventData = { + data: { + "overflowFlag": true + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_FadingEdge_0200] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_FadingEdge_0200] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('tabsTest'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_FadingEdge_0200] fadingEdge:" + obj.$attrs.fadingEdge); + expect(obj.$attrs.fadingEdge).assertEqual('true'); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_FadingEdge_0300 + * @tc.name Tests the fadingEdge property of the tabs component + * @tc.desc set fadingEdge to false + */ + it('ArkUI_Tabs_FadingEdge_0300', 0, async function (done) { + console.info("ArkUI_Tabs_FadingEdge_0300 start"); + + try { + var eventData = { + data: { + "overflowFlag": false + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_FadingEdge_0300] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_FadingEdge_0300] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('tabsTest'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_FadingEdge_0300] fadingEdge:" + obj.$attrs.fadingEdge); + expect(obj.$attrs.fadingEdge).assertEqual('false'); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorColor_0100 + * @tc.name Tests the indicator.color property of the tabs component + * @tc.desc the default indicator.color parameter is "#FF007DFF" + */ + it('ArkUI_Tabs_IndicatorColor_0100', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorColor_0100 start"); + let strJson = getInspectorByKey('indicatorTest5'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorColor_0100] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorColor = obj.$attrs.tabBar.indicator.color; + expect(indicatorColor).assertEqual("#FF007DFF"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorColor_0200 + * @tc.name Tests the indicator.color property of the tabs component + * @tc.desc set indicator.color to number type + */ + it('ArkUI_Tabs_IndicatorColor_0200', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorColor_0200 start"); + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorColor_0200] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorColor = obj.$attrs.tabBar.indicator.color; + expect(indicatorColor).assertEqual("#FFFF0000"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorColor_0300 + * @tc.name Tests the indicator.color property of the tabs component + * @tc.desc set indicator.color to string type + */ + it('ArkUI_Tabs_IndicatorColor_0300', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorColor_0300 start"); + let strJson = getInspectorByKey('indicatorTest2'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorColor_0300] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorColor = obj.$attrs.tabBar.indicator.color; + expect(indicatorColor).assertEqual("#FFFF0000"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorColor_0400 + * @tc.name Tests the indicator.color property of the tabs component + * @tc.desc set indicator.color to Resource type + */ + it('ArkUI_Tabs_IndicatorColor_0400', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorColor_0400 start"); + let strJson = getInspectorByKey('indicatorTest3'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorColor_0400] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorColor = obj.$attrs.tabBar.indicator.color; + expect(indicatorColor).assertEqual("#FFFF0000"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorColor_0500 + * @tc.name Tests the indicator.color property of the tabs component + * @tc.desc set indicator.color to Color type + */ + it('ArkUI_Tabs_IndicatorColor_0500', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorColor_0500 start"); + let strJson = getInspectorByKey('indicatorTest4'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorColor_0500] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorColor = obj.$attrs.tabBar.indicator.color; + expect(indicatorColor).assertEqual("#FFFF0000"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorColor_0600 + * @tc.name Tests the indicator.color property of the tabs component + * @tc.desc set indicator.color to abnormol value "xxxxxxxx" then get the default value "#FF007DFF" + */ + it('ArkUI_Tabs_IndicatorColor_0600', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorColor_0600 start"); + + try { + var eventData = { + data: { + "selfIndicatorColor": "xxxxxxxx" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorColor_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorColor_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorColor_0600] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorColor = obj.$attrs.tabBar.indicator.color; + expect(indicatorColor).assertEqual("#FF007DFF"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorColor_0700 + * @tc.name Tests the indicator property of the tabs component + * @tc.desc set indicator property + */ + it('ArkUI_Tabs_IndicatorColor_0700', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorColor_0700 start"); + + try { + var eventData = { + data: { + "selfIndicatorColor": Color.Red, + "selfIndicatorHeight": 5, + "selfIndicatorWidth": 20, + "selfIndicatorBorderRadius": 5, + "selfMarginTop": 10 + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorColor_0700] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorColor_0700] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorColor_0700] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorColor = obj.$attrs.tabBar.indicator.color; + let indicatorHeight = obj.$attrs.tabBar.indicator.height; + let indicatorWidth = obj.$attrs.tabBar.indicator.width; + let indicatorBorderRadius = obj.$attrs.tabBar.indicator.borderRadius; + let indicatorSpace = obj.$attrs.tabBar.indicator.marginTop; + expect(indicatorColor).assertEqual("#FFFF0000"); + expect(indicatorHeight).assertEqual("5.00vp"); + expect(indicatorWidth).assertEqual("20.00vp"); + expect(indicatorBorderRadius).assertEqual("5.00vp"); + expect(indicatorSpace).assertEqual("10.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorHeight_0100 + * @tc.name Tests the indicator.height property of the tabs component + * @tc.desc the default indicator.height parameter is "2.00vp". + */ + it('ArkUI_Tabs_IndicatorHeight_0100', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorHeight_0100 start ") + let strJson = getInspectorByKey('indicatorTest5'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorHeight_0100] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorHeight = obj.$attrs.tabBar.indicator.height; + expect(indicatorHeight).assertEqual("2.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorHeight_0200 + * @tc.name Tests the indicator.height property of the tabs component + * @tc.desc set indicator.height to number type + */ + it('ArkUI_Tabs_IndicatorHeight_0200', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorHeight_0200 start ") + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorHeight_0200] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorHeight = obj.$attrs.tabBar.indicator.height; + expect(indicatorHeight).assertEqual("10.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorHeight_0300 + * @tc.name Tests the indicator.height property of the tabs component + * @tc.desc set indicator.height to string type + */ + it('ArkUI_Tabs_IndicatorHeight_0300', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorHeight_0300 start ") + let strJson = getInspectorByKey('indicatorTest2'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorHeight_0300] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorHeight = obj.$attrs.tabBar.indicator.height; + expect(indicatorHeight).assertEqual("10.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorHeight_0400 + * @tc.name Tests the indicator.height property of the tabs component + * @tc.desc set indicator.height to resource type + */ + it('ArkUI_Tabs_IndicatorHeight_0400', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorHeight_0400 start ") + let strJson = getInspectorByKey('indicatorTest3'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorHeight_0400] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorHeight = obj.$attrs.tabBar.indicator.height; + expect(indicatorHeight).assertEqual("10.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorHeight_0500 + * @tc.name Tests the indicator.height property of the tabs component + * @tc.desc set indicator.height to abnormol value -1 then get the default value "2.00vp" + */ + it('ArkUI_Tabs_IndicatorHeight_0500', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorHeight_0300 start"); + + try { + var eventData = { + data: { + "selfIndicatorHeight": -1 + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorHeight_0500] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorHeight_0500] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorHeight_0500] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorHeight = obj.$attrs.tabBar.indicator.height; + expect(indicatorHeight).assertEqual("2.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorHeight_0600 + * @tc.name Tests the indicator.height property of the tabs component + * @tc.desc set indicator.height with different length's unit + */ + it('ArkUI_Tabs_IndicatorHeight_0600', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorHeight_0300 start"); + + try { + var eventData = { + data: { + "selfIndicatorHeightStr": "10px" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorHeight_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorHeight_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('indicatorTest2'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorHeight_0600] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorHeight = obj.$attrs.tabBar.indicator.height; + expect(indicatorHeight).assertEqual("10.00px"); + + try { + var eventData = { + data: { + "selfIndicatorHeightStr": "10fp" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorHeight_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorHeight_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + strJson = getInspectorByKey('indicatorTest2'); + obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorHeight_0600] indicator:" + obj.$attrs.tabBar.indicator); + indicatorHeight = obj.$attrs.tabBar.indicator.height; + expect(indicatorHeight).assertEqual("10.00fp"); + + try { + var eventData = { + data: { + "selfIndicatorHeightStr": "10lpx" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorHeight_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorHeight_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + strJson = getInspectorByKey('indicatorTest2'); + obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorHeight_0600] indicator:" + obj.$attrs.tabBar.indicator); + indicatorHeight = obj.$attrs.tabBar.indicator.height; + expect(indicatorHeight).assertEqual("10.00lpx"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorWidth_0100 + * @tc.name Tests the indicator.width property of the tabs component + * @tc.desc the default indicator.width parameter is "0.00vp". + */ + it('ArkUI_Tabs_IndicatorWidth_0100', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorWidth_0100 start"); + let strJson = getInspectorByKey('indicatorTest5'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorWidth_0100] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorWidth = obj.$attrs.tabBar.indicator.width; + expect(indicatorWidth).assertEqual("0.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorWidth_0200 + * @tc.name Tests the indicator.width property of the tabs component + * @tc.desc set indicator.width to number type + */ + it('ArkUI_Tabs_IndicatorWidth_0200', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorWidth_0200 start"); + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorWidth_0200] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorWidth = obj.$attrs.tabBar.indicator.width; + expect(indicatorWidth).assertEqual("30.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorWidth_0300 + * @tc.name Tests the indicator.width property of the tabs component + * @tc.desc set indicator.width to string type + */ + it('ArkUI_Tabs_IndicatorWidth_0300', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorWidth_0300 start"); + let strJson = getInspectorByKey('indicatorTest2'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorWidth_0300] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorWidth = obj.$attrs.tabBar.indicator.width; + expect(indicatorWidth).assertEqual("30.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorWidth_0400 + * @tc.name Tests the indicator.width property of the tabs component + * @tc.desc set indicator.width to Resource type + */ + it('ArkUI_Tabs_IndicatorWidth_0400', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorWidth_0400 start"); + let strJson = getInspectorByKey('indicatorTest3'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorWidth_0400] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorWidth = obj.$attrs.tabBar.indicator.width; + expect(indicatorWidth).assertEqual("30.00vp"); + done(); + }); + + + /** + * @tc.number ArkUI_Tabs_IndicatorWidth_0500 + * @tc.name Tests the indicator.width property of the tabs component + * @tc.desc set indicator.color to abnormol value -1 then get the default value "0.00vp" + */ + it('ArkUI_Tabs_IndicatorWidth_0500', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorWidth_0500 start"); + + try { + var eventData = { + data: { + "selfIndicatorWidth": -1 + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorWidth_0500] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorWidth_0500] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorWidth_0300] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorWidth = obj.$attrs.tabBar.indicator.width; + expect(indicatorWidth).assertEqual("0.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorWidth_0600 + * @tc.name Tests the indicator.width property of the tabs component + * @tc.desc set indicator.width with different length's unit + */ + it('ArkUI_Tabs_IndicatorWidth_0600', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorHeight_0300 start"); + + try { + var eventData = { + data: { + "selfIndicatorWidthStr": "10px" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorWidth_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorWidth_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('indicatorTest2'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorWidth_0600] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorWidth = obj.$attrs.tabBar.indicator.width; + expect(indicatorWidth).assertEqual("10.00px"); + + try { + var eventData = { + data: { + "selfIndicatorWidthStr": "10fp" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorWidth_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorWidth_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + strJson = getInspectorByKey('indicatorTest2'); + obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorWidth_0600] indicator:" + obj.$attrs.tabBar.indicator); + indicatorWidth = obj.$attrs.tabBar.indicator.width; + expect(indicatorWidth).assertEqual("10.00fp"); + + try { + var eventData = { + data: { + "selfIndicatorWidthStr": "10lpx" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorWidth_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorWidth_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + strJson = getInspectorByKey('indicatorTest2'); + obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorWidth_0600] indicator:" + obj.$attrs.tabBar.indicator); + indicatorWidth = obj.$attrs.tabBar.indicator.width; + expect(indicatorWidth).assertEqual("10.00lpx"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorBorderRadius_0100 + * @tc.name Tests the indicator.borderRadius property of the tabs component + * @tc.desc the default indicator.borderRadius parameter is "0.00vp". + */ + it('ArkUI_Tabs_IndicatorBorderRadius_0100', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorBorderRadius_0100 start"); + let strJson = getInspectorByKey('indicatorTest5'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorBorderRadius_0100] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorBorderRadius = obj.$attrs.tabBar.indicator.borderRadius + expect(indicatorBorderRadius).assertEqual("0.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorBorderRadius_0200 + * @tc.name Tests the indicator.borderRadius property of the tabs component + * @tc.desc set indicator.borderRadius to number type + */ + it('ArkUI_Tabs_IndicatorBorderRadius_0200', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorBorderRadius_0200 start"); + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorBorderRadius_0200] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorBorderRadius = obj.$attrs.tabBar.indicator.borderRadius + expect(indicatorBorderRadius).assertEqual("5.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorBorderRadius_0300 + * @tc.name Tests the indicator.borderRadius property of the tabs component + * @tc.desc set indicator.borderRadius to string type + */ + it('ArkUI_Tabs_IndicatorBorderRadius_0300', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorBorderRadius_0300 start"); + let strJson = getInspectorByKey('indicatorTest2'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorBorderRadius_0300] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorBorderRadius = obj.$attrs.tabBar.indicator.borderRadius + expect(indicatorBorderRadius).assertEqual("5.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorBorderRadius_0400 + * @tc.name Tests the indicator.borderRadius property of the tabs component + * @tc.desc set indicator.borderRadius to Resource type + */ + it('ArkUI_Tabs_IndicatorBorderRadius_0400', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorBorderRadius_0400 start"); + let strJson = getInspectorByKey('indicatorTest3'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorBorderRadius_0400] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorBorderRadius = obj.$attrs.tabBar.indicator.borderRadius + expect(indicatorBorderRadius).assertEqual("5.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorBorderRadius_0500 + * @tc.name Tests the indicator.borderRadius property of the tabs component + * @tc.desc set indicator.borderRadius to abnormol value -1 then get the default value "0.00vp" + */ + it('ArkUI_Tabs_IndicatorBorderRadius_0500', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorBorderRadius_0500 start"); + + try { + var eventData = { + data: { + "selfIndicatorBorderRadius": -1 + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorBorderRadius_0500] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorBorderRadius_0500] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorBorderRadius_0500] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorBorderRadius = obj.$attrs.tabBar.indicator.borderRadius; + expect(indicatorBorderRadius).assertEqual("0.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorBorderRadius_0600 + * @tc.name Tests the indicator.borderRadius property of the tabs component + * @tc.desc set indicator.borderRadius with different length's unit + */ + it('ArkUI_Tabs_IndicatorBorderRadius_0600', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorHeight_0300 start"); + + try { + var eventData = { + data: { + "selfIndicatorBorderRadiusStr": "10px" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorBorderRadius_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorBorderRadius_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('indicatorTest2'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorBorderRadius_0600] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorBorderRadius = obj.$attrs.tabBar.indicator.borderRadius; + expect(indicatorBorderRadius).assertEqual("10.00px"); + + try { + var eventData = { + data: { + "selfIndicatorBorderRadiusStr": "10fp" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorBorderRadius_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorBorderRadius_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + strJson = getInspectorByKey('indicatorTest2'); + obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorBorderRadius_0600] indicator:" + obj.$attrs.tabBar.indicator); + indicatorBorderRadius = obj.$attrs.tabBar.indicator.borderRadius; + expect(indicatorBorderRadius).assertEqual("10.00fp"); + + try { + var eventData = { + data: { + "selfIndicatorBorderRadiusStr": "10lpx" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorBorderRadius_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorBorderRadius_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + strJson = getInspectorByKey('indicatorTest2'); + obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorBorderRadius_0600] indicator:" + obj.$attrs.tabBar.indicator); + indicatorBorderRadius = obj.$attrs.tabBar.indicator.borderRadius; + expect(indicatorBorderRadius).assertEqual("10.00lpx"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_SubTabBorderRadius_0100 + * @tc.name Tests the indicator.board.borderRadius property of the tabs component + * @tc.desc the default indicator.height parameter is "8.00vp". + */ + it('ArkUI_Tabs_SubTabBorderRadius_0100', 0, async function (done) { + console.info("ArkUI_Tabs_SubTabBorderRadius_0100 start"); + let strJson = getInspectorByKey('indicatorTest5'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_SubTabBorderRadius_0100] subTabBorderRadius:" + obj.$attrs.tabBar.board.borderRadius); + expect(obj.$attrs.tabBar.board.borderRadius).assertEqual("8.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_SubTabBorderRadius_0200 + * @tc.name Tests the indicator.board.borderRadius property of the tabs component + * @tc.desc set indicator.board.borderRadius to number type + */ + it('ArkUI_Tabs_SubTabBorderRadius_0200', 0, async function (done) { + console.info("ArkUI_Tabs_SubTabBorderRadius_0200 start"); + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_SubTabBorderRadius_0200] subTabBorderRadius:" + obj.$attrs.tabBar.board.borderRadius); + expect(obj.$attrs.tabBar.board.borderRadius).assertEqual("20.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_SubTabBorderRadius_0300 + * @tc.name Tests the indicator.board.borderRadius property of the tabs component + * @tc.desc set indicator.board.borderRadius to string type + */ + it('ArkUI_Tabs_SubTabBorderRadius_0300', 0, async function (done) { + console.info("ArkUI_Tabs_SubTabBorderRadius_0300 start"); + let strJson = getInspectorByKey('indicatorTest2'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_SubTabBorderRadius_0300] subTabBorderRadius:" + obj.$attrs.tabBar.board.borderRadius); + expect(obj.$attrs.tabBar.board.borderRadius).assertEqual("20.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_SubTabBorderRadius_0400 + * @tc.name Tests the indicator.board.borderRadius property of the tabs component + * @tc.desc set indicator.board.borderRadius to Resource type + */ + it('ArkUI_Tabs_SubTabBorderRadius_0400', 0, async function (done) { + console.info("ArkUI_Tabs_SubTabBorderRadius_0400 start"); + let strJson = getInspectorByKey('indicatorTest3'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_SubTabBorderRadius_0400] subTabBorderRadius:" + obj.$attrs.tabBar.board.borderRadius); + expect(obj.$attrs.tabBar.board.borderRadius).assertEqual("20.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_SubTabBorderRadius_0500 + * @tc.name Tests the indicator.board.borderRadius property of the tabs component + * @tc.desc set indicator.board.borderRadius to abnormol value -1 then get the default value "8.00vp" + */ + it('ArkUI_Tabs_SubTabBorderRadius_0500', 0, async function (done) { + console.info("ArkUI_Tabs_SubTabBorderRadius_0500 start"); + + try { + var eventData = { + data: { + "selfSubTabBorderRadius": -1 + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_SubTabBorderRadius_0500] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_SubTabBorderRadius_0500] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_SubTabBorderRadius_0500] subTabBorderRadius:" + obj.$attrs.tabBar.board.borderRadius); + expect(obj.$attrs.tabBar.board.borderRadius).assertEqual("8.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_SubTabBorderRadius_0600 + * @tc.name Tests the indicator.border.borderRadius property of the tabs component + * @tc.desc set indicator.border.borderRadius with different length's unit + */ + it('ArkUI_Tabs_SubTabBorderRadius_0600', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorHeight_0300 start"); + + try { + var eventData = { + data: { + "selfSubTabBorderRadiusStr": "10px" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_SubTabBorderRadius_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_SubTabBorderRadius_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('indicatorTest2'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_SubTabBorderRadius_0600] indicator:" + obj.$attrs.tabBar.board.borderRadius); + expect(obj.$attrs.tabBar.board.borderRadius).assertEqual("10.00px"); + + try { + var eventData = { + data: { + "selfSubTabBorderRadiusStr": "10fp" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_SubTabBorderRadius_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_SubTabBorderRadius_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + strJson = getInspectorByKey('indicatorTest2'); + obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_SubTabBorderRadius_0600] indicator:" + obj.$attrs.tabBar.indicator); + expect(obj.$attrs.tabBar.board.borderRadius).assertEqual("10.00fp"); + + try { + var eventData = { + data: { + "selfSubTabBorderRadiusStr": "10lpx" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_SubTabBorderRadius_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_SubTabBorderRadius_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + strJson = getInspectorByKey('indicatorTest2'); + obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_SubTabBorderRadius_0600] indicator:" + obj.$attrs.tabBar.indicator); + expect(obj.$attrs.tabBar.board.borderRadius).assertEqual("10.00lpx"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_SubTabBorderRadius_0700 + * @tc.name Tests the indicator SelectedMode.BOARD property of the tabs component + * @tc.desc set indicator property with SelectedMode.BOARD + */ + it('ArkUI_Tabs_SubTabBorderRadius_0700', 0, async function (done) { + console.info("ArkUI_Tabs_SubTabBorderRadius_0700 start"); + try { + var eventData = { + data: { + "selfSubTabBorderRadius": 20, + "selfSelectedMode": SelectedMode.BOARD + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_SubTabBorderRadius_0700] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_SubTabBorderRadius_0700] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_SubTabBorderRadius_0700] subTabBorderRadius:" + obj.$attrs.tabBar.board.borderRadius); + expect(obj.$attrs.tabBar.board.borderRadius).assertEqual("20.00vp"); + expect(obj.$attrs.tabBar.selectedMode).assertEqual("SelectedMode.BOARD"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_SelectedMode_0100 + * @tc.name Tests the indicator.selectedMode property of the tabs component + * @tc.desc the default indicator.selectedMode parameter is "SelectedMode.INDICATOR". + */ + it('ArkUI_Tabs_SelectedMode_0100', 0, async function (done) { + console.info("ArkUI_Tabs_SelectedMode_0100 start"); + let strJson = getInspectorByKey('indicatorTest5'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_SelectedMode_0100] selectedMode:" + obj.$attrs.tabBar.selectedMode); + expect(obj.$attrs.tabBar.selectedMode).assertEqual("SelectedMode.INDICATOR"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_SelectedMode_0200 + * @tc.name Tests the indicator.selectedMode property of the tabs component + * @tc.desc set indicator.selectedMode to SelectedMode.INDICATOR + */ + it('ArkUI_Tabs_SelectedMode_0200', 0, async function (done) { + console.info("ArkUI_Tabs_SelectedMode_0200 start"); + + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_SelectedMode_0200] selectedMode:" + obj.$attrs.tabBar.selectedMode); + expect(obj.$attrs.tabBar.selectedMode).assertEqual("SelectedMode.INDICATOR"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_SelectedMode_0300 + * @tc.name Tests the indicator.selectedMode property of the tabs component + * @tc.desc set indicator.selectedMode to SelectedMode.BOARD + */ + it('ArkUI_Tabs_SelectedMode_0300', 0, async function (done) { + console.info("ArkUI_Tabs_SelectedMode_0300 start"); + + try { + var eventData = { + data: { + "selfIndicatorHeight": 10, + "selfSelectedMode": SelectedMode.BOARD + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_SelectedMode_0300] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_SelectedMode_0300] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_SelectedMode_0300] selectedMode:" + obj.$attrs.tabBar.selectedMode); + expect(obj.$attrs.tabBar.selectedMode).assertEqual("SelectedMode.BOARD"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorSpace_0100 + * @tc.name Tests the indicator.marginTop property of the tabs component + * @tc.desc the default indicator.marginTop parameter is "0.00vp". + */ + it('ArkUI_Tabs_IndicatorSpace_0100', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorSpace_0100 start"); + let strJson = getInspectorByKey('indicatorTest4'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorSpace_0100] indicatorSpace:" + obj.$attrs.tabBar.indicator); + let indicatorSpace = obj.$attrs.tabBar.indicator.marginTop; + expect(indicatorSpace).assertEqual("8.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorWidth_0200 + * @tc.name Tests the indicator.marginTop property of the tabs component + * @tc.desc set indicator.width to number type. + */ + it('ArkUI_Tabs_IndicatorSpace_0200', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorSpace_0200 start"); + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorSpace_0200] indicatorSpace:" + obj.$attrs.tabBar.indicator); + let indicatorSpace = obj.$attrs.tabBar.indicator.marginTop; + expect(indicatorSpace).assertEqual("10.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorSpace_0300 + * @tc.name Tests the indicator.marginTop property of the tabs component + * @tc.desc set indicator.width to string type. + */ + it('ArkUI_Tabs_IndicatorSpace_0300', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorSpace_0300 start"); + let strJson = getInspectorByKey('indicatorTest2'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorSpace_0300] indicatorSpace:" + obj.$attrs.tabBar.indicator); + let indicatorSpace = obj.$attrs.tabBar.indicator.marginTop; + expect(indicatorSpace).assertEqual("10.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorSpace_0400 + * @tc.name Tests the indicator.marginTop property of the tabs component + * @tc.desc set indicator.width to Resource type. + */ + it('ArkUI_Tabs_IndicatorSpace_0400', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorSpace_0400 start"); + let strJson = getInspectorByKey('indicatorTest3'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorSpace_0400] indicatorSpace:" + obj.$attrs.tabBar.indicator); + let indicatorSpace = obj.$attrs.tabBar.indicator.marginTop; + expect(indicatorSpace).assertEqual("10.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorSpace_0500 + * @tc.name Tests the indicator.marginTop property of the tabs component + * @tc.desc set indicator.marginTop to abnormol value -1 then get the default value "0.00vp" + */ + it('ArkUI_Tabs_IndicatorSpace_0500', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorSpace_0500 start"); + + try { + var eventData = { + data: { + "selfIndicatorHeight": 10, + "selfMarginTop": -1 + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorSpace_0500] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorSpace_0500] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('indicatorTest1'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorSpace_0500] indicatorSpace:" + obj.$attrs.tabBar.indicator); + let indicatorSpace = obj.$attrs.tabBar.indicator.marginTop; + expect(indicatorSpace).assertEqual("8.00vp"); + done(); + }); + + /** + * @tc.number ArkUI_Tabs_IndicatorSpace_0600 + * @tc.name Tests the indicator.marginTop property of the tabs component + * @tc.desc set indicator.marginTop with different length's unit + */ + it('ArkUI_Tabs_IndicatorSpace_0600', 0, async function (done) { + console.info("ArkUI_Tabs_IndicatorHeight_0300 start"); + + try { + var eventData = { + data: { + "selfMarginTopStr": "10px" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorSpace_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorSpace_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('indicatorTest2'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorSpace_0600] indicator:" + obj.$attrs.tabBar.indicator); + let indicatorSpace = obj.$attrs.tabBar.indicator.marginTop; + expect(indicatorSpace).assertEqual("10.00px"); + + try { + var eventData = { + data: { + "selfMarginTopStr": "10fp" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorSpace_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorSpace_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + strJson = getInspectorByKey('indicatorTest2'); + obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorSpace_0600] indicator:" + obj.$attrs.tabBar.indicator); + indicatorSpace = obj.$attrs.tabBar.indicator.marginTop; + expect(indicatorSpace).assertEqual("10.00fp"); + + try { + var eventData = { + data: { + "selfMarginTopStr": "10lpx" + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Tabs_IndicatorSpace_0600] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Tabs_IndicatorSpace_0600] change component data error: " + err.message); + } + await Utils.sleep(2000); + strJson = getInspectorByKey('indicatorTest2'); + obj = JSON.parse(strJson); + console.info("[ArkUI_Tabs_IndicatorSpace_0600] indicator:" + obj.$attrs.tabBar.indicator); + indicatorSpace = obj.$attrs.tabBar.indicator.marginTop; + expect(indicatorSpace).assertEqual("10.00lpx"); + done(); + }); }) } diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/AppScope/app.json b/arkui/ace_ets_components_ux/ace_ets_component_text/AppScope/app.json new file mode 100755 index 0000000000000000000000000000000000000000..5dd83b68fd4377537c9bc42e21e910932b78d50e --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_text/AppScope/app.json @@ -0,0 +1,19 @@ +{ + "app": { + "bundleName": "com.example.texttest", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/AppScope/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_text/AppScope/resources/base/element/string.json new file mode 100755 index 0000000000000000000000000000000000000000..30af7cfee6766dda361b893d1565490dc145fdf0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_text/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"MyApplication" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_components_ux/ace_ets_component_text/AppScope/resources/base/media/app_icon.png new file mode 100755 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_text/AppScope/resources/base/media/app_icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/BUILD.gn b/arkui/ace_ets_components_ux/ace_ets_component_text/BUILD.gn new file mode 100755 index 0000000000000000000000000000000000000000..eec3a50407d44a1fd18195a742ed708ddf25981f --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_text/BUILD.gn @@ -0,0 +1,43 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAceTextTest") { + hap_profile = "src/main/module.json" + js_build_mode = "debug" + deps = [ + ":ace_ets_component_text_js_assets", + ":ace_ets_component_text_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsAceTextTest" + part_name = "ace_engine" + subsystem_name = "arkui" +} + +ohos_app_scope("ace_ets_component_text_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("ace_ets_component_text_js_assets") { + source_dir = "src/main/ets" +} + +ohos_resources("ace_ets_component_text_resources") { + sources = [ "src/main/resources" ] + deps = [ ":ace_ets_component_text_profile" ] + hap_profile = "src/main/module.json" +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/Test.json b/arkui/ace_ets_components_ux/ace_ets_component_text/Test.json new file mode 100755 index 0000000000000000000000000000000000000000..dc463d6bfd8e2db2733dd67a856201931fd03b53 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_text/Test.json @@ -0,0 +1,26 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "600000", + "bundle-name": "com.example.texttest", + "module-name": "phone", + "shell-timeout": "600000", + "testcase-timeout": 240000 + }, + "kits": [{ + "test-file-name": [ + "ActsAceTextTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "power-shell wakeup", + "power-shell setmode 602" + ] + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/signature/openharmony_sx.p7b b/arkui/ace_ets_components_ux/ace_ets_component_text/signature/openharmony_sx.p7b new file mode 100755 index 0000000000000000000000000000000000000000..b33d724934f29163c2c340d4cbe9d0dfd2a24a7f Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_text/signature/openharmony_sx.p7b differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/TestAbility/TestAbility.ets b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/TestAbility/TestAbility.ets new file mode 100755 index 0000000000000000000000000000000000000000..8d65dd2ea8346a8b5d12ac7aff026197a95abaea --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/TestAbility/TestAbility.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import Ability from '@ohos.app.ability.UIAbility' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import testsuite from '../test/List.test' +import Window from '@ohos.window' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('TestAbility/pages/Index', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/TestAbility/pages/Index.ets b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/TestAbility/pages/Index.ets new file mode 100755 index 0000000000000000000000000000000000000000..f192a3fc7c700fb2ae174e26d804e3cf7022510f --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/TestAbility/pages/Index.ets @@ -0,0 +1,408 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +//@ts-nocheck +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import hilog from '@ohos.hilog'; +import testsuite from '../../test/List.test' +@Entry +@Component +struct textTest { + aboutToAppear(){ + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + @State overMessage: string = 'This is the setting of textOverflow to Clip text content This is the setting of textO' + + 'verflow to None text content. This is the setting of textOverflow to Clip text content This is the setting of ' + @State message: string = "hello text" + @State handlePopup: boolean = false + + build() { + Column() { + List({ space: 0, initialIndex: 0 }) { + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_0100') + .height(20) + + } + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_0200') + .height(20) + .textShadow({ radius: 1 }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_0300') + .height(20) + .textShadow({ radius: 0 }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_0400') + .height(20) + .textShadow({ radius: 20 }) + + } + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_0500') + .height(20) + .textShadow({ radius: $r("app.float.textShadowRadius") }) + + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_0600') + .height(20) + .textShadow({ radius: -1 }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_0700') + .height(20) + .textShadow({ radius: 1, color: "#0000FF" }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_0800') + .height(20) + .textShadow({ radius: 1, color: 0xff0000 }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_0900') + .height(20) + .textShadow({ radius: 1, color: Color.Red }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_1000') + .height(20) + .textShadow({ radius: 1, color: $r("app.color.textShadow_Color") }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_1100') + .height(20) + .textShadow({ radius: 1, color: null }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_1200') + .height(20) + .textShadow({ radius: 1, offsetX: 5.0 }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_1300') + .height(20) + .textShadow({ radius: 1, offsetX: -5.0 }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_1400') + .height(20) + .textShadow({ radius: 1, offsetY: 5.0 }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_1500') + .height(20) + .textShadow({ radius: 1, offsetY: -5.0 }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_1600') + .height(20) + .textShadow({ radius: 1, offsetX: 5.0, offsetY: 5.0 }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_1700') + .height(20) + .textShadow({ radius: 1, offsetX: 5.0, offsetY: -5.0 }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_1800') + .height(20) + .textShadow({ radius: 1, offsetX: -5.0, offsetY: 5.0 }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_1900') + .height(20) + .textShadow({ radius: 1, offsetX: -5.0, offsetY: -5.0 }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_2000') + .height(20) + .textShadow({ radius: 1, color: "#0000FF", offsetX: 5.0, offsetY: -5.0 }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_2100') + .height(20) + .textShadow(null) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_2200') + .height(20) + .textShadow({ + radius: 1, color: Color.Red, offsetX: $r("app.float.textShadowOffset"), + offsetY: $r("app.float.textShadowOffset") + }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_2300') + .height(20) + .textShadow({ radius: 1, color: Color.Red, offsetX: " ", offsetY: " " }) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextShadow_2400') + .height(20) + .textShadow({ radius: 1, color: Color.Red, offsetX: 1.0, offsetY: 1.0 }) + .textShadow({ radius: 1, color: null, offsetX: null, offsetY: null }) + } + + ListItem() { + Text(this.overMessage) + .key('ArkUX_Stage_Text_TextOverflow_0100') + .height(20) + .maxLines(1) + } + + ListItem() { + Text(this.overMessage) + .key('ArkUX_Stage_Text_TextOverflow_0200') + .height(20) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Clip }) + } + + ListItem() { + Text('a b v c c a ad') + .key('ArkUX_Stage_Text_TextOverflow_0300') + .height(20) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Clip }) + } + + ListItem() { + Text(this.overMessage) + .key('ArkUX_Stage_Text_TextOverflow_0400') + .height(20) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + } + + ListItem() { + Text('gao is a bbb') + .key('ArkUX_Stage_Text_TextOverflow_0500') + .height(20) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + } + + ListItem() { + Text(this.overMessage) + .key('ArkUX_Stage_Text_TextOverflow_0600') + .height(20) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.None }) + } + + ListItem() { + Text(this.overMessage) + .key('ArkUX_Stage_Text_TextOverflow_0700') + .height(20) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Marquee }) + } + + ListItem() { + Text(this.overMessage) + .key('ArkUX_Stage_Text_TextOverflow_0800') + .height(20) + .maxLines(1) + .textOverflow(null) + } + + ListItem() { + Text(this.overMessage) + .key('ArkUX_Stage_Text_TextOverflow_0900') + .height(20) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Clip }) + .fontSize(15) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextAlign_0100') + .height(20) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextAlign_0200') + .height(20) + .textAlign(TextAlign.Start) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextAlign_0300') + .height(20) + .textAlign(TextAlign.Center) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextAlign_0400') + .height(20) + .textAlign(TextAlign.End) + } + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextAlign_0500') + .height(20) + .textAlign(TextAlign.Justify) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextAlign_0600') + .height(20) + .textAlign(null) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_TextAlign_0700') + .height(20) + .maxLines(1) + .textAlign(TextAlign.End) + .textOverflow({ overflow: TextOverflow.Clip }) + } + + ListItem() { + Text(this.overMessage) + .key('ArkUX_Stage_Text_heightAdaptivePolicy_0100') + .height(20) + .minFontSize(10) + .maxFontSize(20) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + + } + + ListItem() { + Text(this.overMessage) + .key('ArkUX_Stage_Text_heightAdaptivePolicy_0200') + .height(20) + .minFontSize(10) + .maxFontSize(20) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_heightAdaptivePolicy_0300') + .height(20) + .minFontSize(10) + .maxFontSize(20) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_heightAdaptivePolicy_0400') + .height(20) + .minFontSize(10) + .maxFontSize(20) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .heightAdaptivePolicy(null) + } + + ListItem() { + Text(this.message) + .key('ArkUX_Stage_Text_heightAdaptivePolicy_0500') + .height(20) + .minFontSize(10) + .maxFontSize(20) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + } + + ListItem() { + Text(this.message) + .height(20) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + messageOptions: { textColor: Color.Blue, font: { weight: FontWeight.Bolder, size: 25 } }, + targetSpace: 50, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false + } + } + }) + } + } + } + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100755 index 0000000000000000000000000000000000000000..d6c662824093f9339085214d247c6247faa86ae9 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s it', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${targetParams} ${key} ${parameters[key]}` + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/test/List.test.ets b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/test/List.test.ets new file mode 100755 index 0000000000000000000000000000000000000000..a3ff6ed25d7ab7e41cc927a10f33e14e0dfeac77 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import textTest from './text' + +export default function testsuite() { + textTest() +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/test/text.ets b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/test/text.ets new file mode 100755 index 0000000000000000000000000000000000000000..1809b7889f566cd6a7acff4a5a061d3df9dd2a6e --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/test/text.ets @@ -0,0 +1,1108 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// @ts-nocheck +import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' +export default function textTest() { + describe('ActsTextTest', function () { + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_0100 + * @tc.name Test the textShadow property of the text component + * @tc.dec Do not set textShadow property + */ + it('ArkUX_Stage_Text_TextShadow_0100', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_0100] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_0100'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow is :" + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("0.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_0100 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_0200 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value int the textShadow attribute to 1.0 + */ + it('ArkUX_Stage_Text_TextShadow_0200', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_0200] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_0200'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow is:" + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_0200 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_0300 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value int the textShadow attribute to 0 + */ + it('ArkUX_Stage_Text_TextShadow_0300', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_0300] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_0300'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("0.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_0300 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_0400 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value int the textShadow attribute to 20.0 + */ + it('ArkUX_Stage_Text_TextShadow_0400', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_0400] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_0400'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("20.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_0400 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_0500 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value int the textShadow attribute to + * $r("app.float.textShadowRadius") + */ + it('ArkUX_Stage_Text_TextShadow_0500', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_0500] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_0500'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("5.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_0500 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_0600 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value int the textShadow attribute to -1 + */ + it('ArkUX_Stage_Text_TextShadow_0600', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_0600] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_0600'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("0.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_0600 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_0700 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the color value to "#0000FF" + * in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_0700', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_0700] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_0700'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF0000FF") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_0700 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_0800 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the color value to 0xff0000 in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_0800', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_0800] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_0800'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FFFF0000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_0800 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_0900 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the color value to Color.Red in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_0900', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_0900] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_0900'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FFFF0000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_0900 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_1000 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the color value to $r("app.color.textShadow_Color") + * in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_1000', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_1000] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_1000'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FFFD0000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_1000 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_1100 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the color value to null in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_1100', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_1100] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_1100'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_1100 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_1200 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the offsetX value to 5.0 in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_1200', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_1200] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_1200'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("5.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_1200 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_1300 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the offsetX value to -5.0 in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_1300', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_1300] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_1300'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("-5.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_1300 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_1400 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the offsetY value to 5.0 in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_1400', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_1400] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_1400'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("5.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_1400 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_1500 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the offsetY value to -5.0 in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_1500', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_0100] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_1500'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("-5.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_1500 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_1500 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the offsetX value to 5.0 and the offsetY value to 5.0 in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_1600', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_1600] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_1600'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("5.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("5.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_1600 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_1700 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the offsetX value to 5.0 and the offsetY value to -5.0 in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_1700', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_1700] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_1700'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("5.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("-5.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_1700 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_1800 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the offsetX value to -5.0 and the offsetY value to 5.0 in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_1800', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_1800] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_1800'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("-5.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("5.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_1800 ERROR: ' + JSON.stringify(err)) + } + done(); + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_1900 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the offsetX value to -5.0 and the offsetY value to -5.0 in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_1900', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_1900] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_1900'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("-5.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("-5.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_1900 ERROR: ' + JSON.stringify(err)) + } + done(); + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_2000 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the color value to "#0000FF" and the offsetX value to 5.0 and the offsetY value to + * -5.0 in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_2000', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_0100] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_2000'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF0000FF") + expect(obj.$attrs.textShadow.offsetX).assertEqual("5.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("-5.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_2000 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_2100 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the textShadow value to null + */ + it('ArkUX_Stage_Text_TextShadow_2100', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_0100] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_2100'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("0.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_2000 ERROR: ' + JSON.stringify(err)) + } + done(); + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_2200 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the color value to Color.Red and the offsetX value to $r("app.float.textShadowOffset") and the offsetY + * value to $r("app.float.textShadowOffset") in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_2200', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_2200] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_2200'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FFFF0000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("5.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("5.000000") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_2200 ERROR: ' + JSON.stringify(err)) + } + done(); + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_2300 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the color value to Color.Red and the offsetX value to null and the offsetY value to + * null in the textShadow + */ + it('ArkUX_Stage_Text_TextShadow_2300', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_2300] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_2300'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FFFF0000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_2300 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextShadow_2400 + * @tc.name Test the textShadow property of the text component + * @tc.dec Set the radius value to 1.0 and the color value to Color.Red and the offsetX value to 1.0 and the offsetY value to 1.0 + * in the textShadow and then set the radius value to 1.0 and others to null + */ + it('ArkUX_Stage_Text_TextShadow_2400', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextShadow_2400] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextShadow_2400'); + let obj = JSON.parse(strJson); + console.info("--->Text Shadow " + JSON.stringify(obj.$attrs.textShadow)) + expect(obj.$attrs.textShadow.radius).assertEqual("1.000000") + expect(obj.$attrs.textShadow.color).assertEqual("#FF000000") + expect(obj.$attrs.textShadow.offsetX).assertEqual("0.000000") + expect(obj.$attrs.textShadow.offsetY).assertEqual("0.000000") + done(); + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextShadow_2400 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextOverflow_0100 + * @tc.name Test the textOverflow property of the text component + * @tc.dec Do not set the textOverflow property value + */ + it('ArkUX_Stage_Text_TextOverflow_0100', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextOverflow_0100] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextOverflow_0100'); + let obj = JSON.parse(strJson); + console.info("--->text Overflow is " + JSON.stringify(obj.$attrs.textOverflow)) + expect(obj.$attrs.textOverflow).assertEqual("TextOverflow.Clip") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextOverflow_0100 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextOverflow_0200 + * @tc.name Test the textOverflow property of the text component + * @tc.dec Set the textOverflow property value to TextOverflow.Clip + */ + it('ArkUX_Stage_Text_TextOverflow_0200', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextOverflow_0200] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextOverflow_0200'); + let obj = JSON.parse(strJson); + console.info("--->text Overflow is " + JSON.stringify(obj.$attrs.textOverflow)) + expect(obj.$attrs.textOverflow).assertEqual("TextOverflow.Clip") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextOverflow_0200 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextOverflow_0300 + * @tc.name Test the textOverflow property of the text component + * @tc.dec Set the textOverflow property value to TextOverflow.Clip + */ + it('ArkUX_Stage_Text_TextOverflow_0300', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextOverflow_0300] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextOverflow_0300'); + let obj = JSON.parse(strJson); + console.info("--->text Overflow is " + JSON.stringify(obj.$attrs.textOverflow)) + expect(obj.$attrs.textOverflow).assertEqual("TextOverflow.Clip") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextOverflow_0300 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextOverflow_0400 + * @tc.name Test the textOverflow property of the text component + * @tc.dec Set the textOverflow property value to TextOverflow.Ellipsis + */ + it('ArkUX_Stage_Text_TextOverflow_0400', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextOverflow_0400] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextOverflow_0400'); + let obj = JSON.parse(strJson); + console.info("--->text Overflow is " + JSON.stringify(obj.$attrs.textOverflow)) + expect(obj.$attrs.textOverflow).assertEqual("TextOverflow.Ellipsis") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextOverflow_0400 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextOverflow_0500 + * @tc.name Test the textOverflow property of the text component + * @tc.dec Set the textOverflow property value to TextOverflow.Ellipsis + */ + it('ArkUX_Stage_Text_TextOverflow_0500', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextOverflow_0500] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextOverflow_0500'); + let obj = JSON.parse(strJson); + console.info("--->text Overflow is " + JSON.stringify(obj.$attrs.textOverflow)) + expect(obj.$attrs.textOverflow).assertEqual("TextOverflow.Ellipsis") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextOverflow_0500 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextOverflow_0600 + * @tc.name Test the textOverflow property of the text component + * @tc.dec Set the textOverflow property value to TextOverflow.None + */ + it('ArkUX_Stage_Text_TextOverflow_0600', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextOverflow_0600] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextOverflow_0600'); + let obj = JSON.parse(strJson); + console.info("--->text Overflow is " + JSON.stringify(obj.$attrs.textOverflow)) + expect(obj.$attrs.textOverflow).assertEqual("TextOverflow.None") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextOverflow_0600 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextOverflow_0700 + * @tc.name Test the textOverflow property of the text component + * @tc.dec Set the textOverflow property value to TextOverflow.Marquee + */ + it('ArkUX_Stage_Text_TextOverflow_0700', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextOverflow_0700] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextOverflow_0700'); + let obj = JSON.parse(strJson); + console.info("--->text Overflow is " + JSON.stringify(obj.$attrs.textOverflow)) + expect(obj.$attrs.textOverflow).assertEqual("TextOverflow.Marquee") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextOverflow_0700 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextOverflow_0800 + * @tc.name Test the textOverflow property of the text component + * @tc.dec Set the textOverflow property value to null + */ + it('ArkUX_Stage_Text_TextOverflow_0800', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextOverflow_0800] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextOverflow_0800'); + let obj = JSON.parse(strJson); + console.info("--->text Overflow is " + JSON.stringify(obj.$attrs.textOverflow)) + expect(obj.$attrs.textOverflow).assertEqual("TextOverflow.Clip") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextOverflow_0800 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextOverflow_0800 + * @tc.name Test the textOverflow property of the text component + * @tc.dec Set the textOverflow property value to TextOverflow.Clip and the fontSize value to 15.00fp + */ + it('ArkUX_Stage_Text_TextOverflow_0900', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextOverflow_0900] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextOverflow_0900'); + let obj = JSON.parse(strJson); + console.info("--->text Overflow is " + JSON.stringify(obj.$attrs.textOverflow)) + expect(obj.$attrs.textOverflow).assertEqual("TextOverflow.Clip") + console.info("--->fontSize is :" + JSON.stringify(obj.$attrs.fontSize)) + expect(obj.$attrs.fontSize).assertEqual("15.00fp") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextOverflow_0900 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextAlign_0100 + * @tc.name Test the textAlign property of the text component + * @tc.dec Do not set the textAlign property value to null + */ + it('ArkUX_Stage_Text_TextAlign_0100', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextAlign_0100] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextAlign_0100'); + let obj = JSON.parse(strJson); + console.info("--->textAlign is: " + JSON.stringify(obj.$attrs.textAlign)) + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Start") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextAlign_0100 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextAlign_0200 + * @tc.name Test the textAlign property of the text component + * @tc.dec Set the textAlign property value to TextAlign.Start + */ + it('ArkUX_Stage_Text_TextAlign_0200', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextAlign_0100] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextAlign_0200'); + let obj = JSON.parse(strJson); + console.info("--->textAlign is: " + JSON.stringify(obj.$attrs.textAlign)) + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Start") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextAlign_0200 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextAlign_0300 + * @tc.name Test the textAlign property of the text component + * @tc.dec Set the textAlign property value to TextAlign.Center + */ + it('ArkUX_Stage_Text_TextAlign_0300', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextAlign_0300] START'); + setTimeout(() => { + try { + + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextAlign_0300'); + let obj = JSON.parse(strJson); + console.info("--->textAlign is: " + JSON.stringify(obj.$attrs.textAlign)) + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Center") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextAlign_0300 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextAlign_0400 + * @tc.name Test the textAlign property of the text component + * @tc.dec Set the textAlign property value to End + */ + it('ArkUX_Stage_Text_TextAlign_0400', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextAlign_0400] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextAlign_0400'); + let obj = JSON.parse(strJson); + console.info("--->textAlign is: " + JSON.stringify(obj.$attrs.textAlign)) + expect(obj.$attrs.textAlign).assertEqual("TextAlign.End") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextAlign_0400 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextAlign_0500 + * @tc.name Test the textAlign property of the text component + * @tc.dec Set the textAlign property value to Justify + */ + it('ArkUX_Stage_Text_TextAlign_0500', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextAlign_0500] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextAlign_0500'); + let obj = JSON.parse(strJson); + console.info("--->textAlign is: " + JSON.stringify(obj.$attrs.textAlign)) + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Justify") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextAlign_0500 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextAlign_0600 + * @tc.name Test the textAlign property of the text component + * @tc.dec Set the textAlign property value to null + */ + it('ArkUX_Stage_Text_TextAlign_0600', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextAlign_0600] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextAlign_0600'); + let obj = JSON.parse(strJson); + console.info("--->textAlign is: " + JSON.stringify(obj.$attrs.textAlign)) + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Start") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextAlign_0600 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_TextAlign_0700 + * @tc.name Test the textAlign property of the text component + * @tc.dec Set the textAlign property value to Justify and the textOverflow value to TextOverflow.Clip + */ + it('ArkUX_Stage_Text_TextAlign_0700', 0, async function (done) { + console.info('[ArkUX_Stage_Text_TextAlign_0700] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_TextAlign_0700'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.textAlign).assertEqual("TextAlign.End") + console.info("--->textAlign is: " + JSON.stringify(obj.$attrs.textAlign)) + expect(obj.$attrs.textOverflow).assertEqual("TextOverflow.Clip") + console.info("--->textOverflow is: " + JSON.stringify(obj.$attrs.textAlign)) + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_TextAlign_0700 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_heightAdaptivePolicy_0100 + * @tc.name Test the heightAdaptivePolicy property of the text component + * @tc.dec Set the heightAdaptivePolicy property value to TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST + */ + it('ArkUX_Stage_Text_heightAdaptivePolicy_0100', 0, async function (done) { + console.info('[ArkUX_Stage_Text_heightAdaptivePolicy_0100] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_heightAdaptivePolicy_0100'); + let obj = JSON.parse(strJson); + console.info("--->Text heightAdaptivePolicy is: " + + JSON.stringify(obj.$attrs.heightAdaptivePolicy)) + expect(obj.$attrs.heightAdaptivePolicy) + .assertEqual("TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_heightAdaptivePolicy_0100 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_heightAdaptivePolicy_0200 + * @tc.name Test the heightAdaptivePolicy property of the text component + * @tc.dec Set the heightAdaptivePolicy property value to TextHeightAdaptivePolicy.MAX_LINES_FIRST + */ + it('ArkUX_Stage_Text_heightAdaptivePolicy_0200', 0, async function (done) { + console.info('[ArkUX_Stage_Text_heightAdaptivePolicy_0200] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_heightAdaptivePolicy_0200'); + let obj = JSON.parse(strJson); + console.info("--->Text heightAdaptivePolicy is: " + + JSON.stringify(obj.$attrs.heightAdaptivePolicy)) + console.info("--->Text heightAdaptivePolicy is: " + + JSON.stringify(obj.$attrs.heightAdaptivePolicy)) + expect(obj.$attrs.heightAdaptivePolicy) + .assertEqual("TextHeightAdaptivePolicy.MAX_LINES_FIRST") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_heightAdaptivePolicy_0200 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_heightAdaptivePolicy_0300 + * @tc.name Test the heightAdaptivePolicy property of the text component + * @tc.dec Set the heightAdaptivePolicy property value to TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST + */ + it('ArkUX_Stage_Text_heightAdaptivePolicy_0300', 0, async function (done) { + console.info('[ArkUX_Stage_Text_heightAdaptivePolicy_0300] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_heightAdaptivePolicy_0300'); + let obj = JSON.parse(strJson); + console.info("--->Text heightAdaptivePolicy is: " + + JSON.stringify(obj.$attrs.heightAdaptivePolicy)) + expect(obj.$attrs.heightAdaptivePolicy) + .assertEqual("TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_heightAdaptivePolicy_0300 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_heightAdaptivePolicy_0400 + * @tc.name Test the heightAdaptivePolicy property of the text component + * @tc.dec Set the heightAdaptivePolicy property value to TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST and then Set the + * heightAdaptivePolicy property value to null + */ + it('ArkUX_Stage_Text_heightAdaptivePolicy_0400', 0, async function (done) { + console.info('[ArkUX_Stage_Text_heightAdaptivePolicy_0400] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_heightAdaptivePolicy_0400'); + let obj = JSON.parse(strJson); + console.info("--->Text heightAdaptivePolicy is: " + + JSON.stringify(obj.$attrs.heightAdaptivePolicy)) + expect(obj.$attrs.heightAdaptivePolicy) + .assertEqual("TextHeightAdaptivePolicy.MAX_LINES_FIRST") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_heightAdaptivePolicy_0400 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + + /** + * @tc.number ArkUX_Stage_Text_heightAdaptivePolicy_0500 + * @tc.name Test the heightAdaptivePolicy property of the text component + * @tc.dec Set the heightAdaptivePolicy property value to TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST and then Set the + * heightAdaptivePolicy property value to MIN_FONT_SIZE_FIRST + */ + it('ArkUX_Stage_Text_heightAdaptivePolicy_0500', 0, async function (done) { + console.info('[ArkUX_Stage_Text_heightAdaptivePolicy_0500] START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_Text_heightAdaptivePolicy_0500'); + let obj = JSON.parse(strJson); + console.info("--->Text heightAdaptivePolicy is: " + + JSON.stringify(obj.$attrs.heightAdaptivePolicy)) + expect(obj.$attrs.heightAdaptivePolicy) + .assertEqual("TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST") + done() + } catch (err) { + expect().assertFail() + console.info('ArkUX_Stage_Text_heightAdaptivePolicy_0500 ERROR: ' + JSON.stringify(err)) + done() + } + }, 500) + }) + }) +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/module.json b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/module.json new file mode 100755 index 0000000000000000000000000000000000000000..2b03fde2a1898cf911b3b3f2f94a553bca8ebb86 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/module.json @@ -0,0 +1,41 @@ +{ + "module": { + "name": "phone", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "visible": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/resources/base/element/color.json b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/resources/base/element/color.json new file mode 100755 index 0000000000000000000000000000000000000000..8f1cb0ff8cc6c876f553e49bbd3b08ffaf507eba --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/resources/base/element/color.json @@ -0,0 +1,16 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "Divider_color", + "value": "#000000" + }, + { + "name": "textShadow_Color", + "value": "#FFFD0000" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/resources/base/element/float.json b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/resources/base/element/float.json new file mode 100755 index 0000000000000000000000000000000000000000..89f9417f18ebbc9af2ff246060df5dd9e3ac3a0a --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/resources/base/element/float.json @@ -0,0 +1,12 @@ +{ + "float": [ + { + "name": "textShadowRadius", + "value": "5.0" + }, + { + "name": "textShadowOffset", + "value": "5.0" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/resources/base/element/string.json new file mode 100755 index 0000000000000000000000000000000000000000..3ca01713ce9bb325f92762c293ef26039e9c5eab --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + }, + { + "name": "Divider_width", + "value": "10px" + }, + { + "name": "Divider_startMargin", + "value": "5px" + }, + { + "name": "Divider_endMargin", + "value": "5px" + }, + { + "name": "textInput_Size_test", + "value": "4" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/resources/base/media/icon.png b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/resources/base/media/icon.png new file mode 100755 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/resources/base/media/icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/resources/base/profile/test_pages.json b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/resources/base/profile/test_pages.json new file mode 100755 index 0000000000000000000000000000000000000000..77e90731b5a38d861663029b483df3d3ac9ec74b --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "TestAbility/pages/Index" + ] +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/AppScope/app.json b/arkui/ace_ets_components_ux/ace_ets_component_textinput/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..f2dc4d5d27895daa49b91572298c918a83687bcc --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textinput/AppScope/app.json @@ -0,0 +1,19 @@ +{ + "app": { + "bundleName": "com.example.textinputtest", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/AppScope/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_textinput/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..30af7cfee6766dda361b893d1565490dc145fdf0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textinput/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"MyApplication" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_components_ux/ace_ets_component_textinput/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_textinput/AppScope/resources/base/media/app_icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/BUILD.gn b/arkui/ace_ets_components_ux/ace_ets_component_textinput/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..2ca5d578a5d61da85ef60dd8eead7dfc330bf42b --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textinput/BUILD.gn @@ -0,0 +1,43 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAceTextInputTest") { + hap_profile = "src/main/module.json" + js_build_mode = "debug" + deps = [ + ":ace_ets_component_textinput_js_assets", + ":ace_ets_component_textinput_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsAceTextInputTest" + part_name = "ace_engine" + subsystem_name = "arkui" +} + +ohos_app_scope("ace_ets_component_textinput_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("ace_ets_component_textinput_js_assets") { + source_dir = "src/main/ets" +} + +ohos_resources("ace_ets_component_textinput_resources") { + sources = [ "src/main/resources" ] + deps = [ ":ace_ets_component_textinput_profile" ] + hap_profile = "src/main/module.json" +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/Test.json b/arkui/ace_ets_components_ux/ace_ets_component_textinput/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..b000462556865643f544b493d41fa0b0c0a21562 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textinput/Test.json @@ -0,0 +1,26 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "600000", + "bundle-name": "com.example.textinputtest", + "module-name": "phone", + "shell-timeout": "600000", + "testcase-timeout": 240000 + }, + "kits": [{ + "test-file-name": [ + "ActsAceTextInputTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "power-shell wakeup", + "power-shell setmode 602" + ] + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/signature/openharmony_sx.p7b b/arkui/ace_ets_components_ux/ace_ets_component_textinput/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..61eee060f99107fe262620bffbff84af61ae6f54 Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_textinput/signature/openharmony_sx.p7b differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/TestAbility/TestAbility.ets b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/TestAbility/TestAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d65dd2ea8346a8b5d12ac7aff026197a95abaea --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/TestAbility/TestAbility.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import Ability from '@ohos.app.ability.UIAbility' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import testsuite from '../test/List.test' +import Window from '@ohos.window' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('TestAbility/pages/Index', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/TestAbility/pages/Index.ets b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/TestAbility/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..129fbe321de43599f584680cdf11ea948d87c745 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/TestAbility/pages/Index.ets @@ -0,0 +1,602 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + //@ts-nocheck +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import hilog from '@ohos.hilog'; +import testsuite from '../../test/List.test' +@Entry +@Component +struct textInputTest { + aboutToAppear(){ + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + build() { + Row() { + Column() { + List({space: 0, initialIndex: 0 }){ + ListItem(){ + TextInput({ placeholder: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretPosition_0100") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretPosition(3) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretPosition_0200") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretPosition(0) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretPosition_0300") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretPosition(7) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretPosition_0400") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretPosition("7") + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretPosition_0500") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretPosition($r("app.string.textInput_Size_test")) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretPosition_0600") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretPosition(100) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretPosition_0700") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretPosition("") + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretPosition_0800") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretPosition(-1) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretPosition_0900") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretPosition(null) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretPosition_1000") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretPosition(undefined) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretPosition_1100") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretPosition(7) + .caretPosition(3) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretPosition_1200") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretPosition(7) + .caretPosition(undefined) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretPosition_1300") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretPosition(7) + .position(null) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "To display string text for extra long To display string text for extra long ", + controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretPosition_1400") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretPosition(70) + .margin(20) + .fontSize(20) + .fontColor(Color.Black) + .style(TextInputStyle.Default) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretWidth_0100") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretStyle({ caretWidth : 0}) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretWidth_0200") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretStyle({ caretWidth : 7}) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretWidth_0300") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretStyle({ caretWidth : "7vp" }) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretWidth_0400") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretStyle({ caretWidth : $r("app.string.textInput_Size_test") }) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretWidth_0500") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretStyle({ caretWidth : -1}) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretWidth_0600") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretStyle({ caretWidth : "" }) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretWidth_0700") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretStyle({ caretWidth : null }) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretWidth_0800") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretStyle({ caretWidth : undefined }) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretWidth_0900") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretStyle({ caretWidth : "asff%6&"}) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretWidth_1000") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretStyle({ caretWidth : 7 }) + .caretStyle({ caretWidth : "2fp" }) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretWidth_1100") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretStyle({ caretWidth : 7 }) + .caretStyle({ caretWidth : undefined }) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_CaretWidth_1200") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .caretStyle({ caretWidth : "7lpx" }) + .margin(20) + .fontSize(14) + .width(null) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_selectedColor_0100") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .selectedBackgroundColor(0x00ff00) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_selectedColor_0200") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .selectedBackgroundColor("#fffd0000") + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_selectedColor_0300") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .selectedBackgroundColor('rgb(138,43,226)') + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_selectedColor_0400") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .selectedBackgroundColor(Color.Pink) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_selectedColor_0500") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .selectedBackgroundColor($r("app.color.TextInput_Color")) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_selectedColor_0600") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .selectedBackgroundColor("") + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_selectedColor_0700") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .selectedBackgroundColor(null) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_selectedColor_0800") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .selectedBackgroundColor(undefined) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_selectedColor_0900") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .selectedBackgroundColor(Color.Pink) + .selectedBackgroundColor("#FFFD0000") + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_selectedColor_1000") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .selectedBackgroundColor(Color.Pink) + .selectedBackgroundColor(undefined) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_selectedColor_1100") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .selectedBackgroundColor(0x00ff00) + .backgroundColor(null) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_selectedColor_1200") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .selectedBackgroundColor(0x00ff00) + .caretStyle({ caretWidth : 7 }) + .caretPosition(4) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + ListItem(){ + TextInput({ text: "input your word...", controller: this.controller }) + .key("ArkUX_Stage_TextInput_selectedColor_1300") + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .onChange((value: string) => { + this.text = value; + }) + } + } + } + .width('100%') + } + .height('100%') + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6c662824093f9339085214d247c6247faa86ae9 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s it', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${targetParams} ${key} ${parameters[key]}` + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/test/List.test.ets b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..bebdc48463b2434e4ba1b35dd23b3f992456a721 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import textInputTest from './textinput' + +export default function testsuite() { + textInputTest() +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/test/textinput.ets b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/test/textinput.ets new file mode 100644 index 0000000000000000000000000000000000000000..c252d69437dce4c1e654957611c16f1272d162e8 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/test/textinput.ets @@ -0,0 +1,994 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// @ts-nocheck +import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' +let emitKey = "emitUserAgent"; +export default function textInputTest() { + describe('ActsTextInputTest', function () { + + /* + *tc.number ArkUX_Stage_TextInput_CaretPosition_0100 + *tc.name Support modifying the cursor position change of TextInput component + *tc.desc The component does not have a text parameter. Set the caretPosition property parameter to 3 + */ + it('ArkUX_Stage_TextInput_CaretPosition_0100', 0, async function (done) { + console.info('ArkUX_Stage_Badge_FontWeight_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretPosition_0100'); + console.info('ArkUX_Stage_TextInput_CaretPosition_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretPosition_0100 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + expect(obj.$attrs.caretPosition).assertEqual("0"); + console.info('ArkUX_Stage_TextInput_CaretPosition_0100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretPosition_0100 ERR ' + JSON.stringify(err)); + } + done(); + }, 5000) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretPosition_0200 + *tc.name Support modifying the cursor position change of TextInput component + *tc.desc Sets the caretPosition property parameter to 0 + */ + it('ArkUX_Stage_TextInput_CaretPosition_0200', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretPosition_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretPosition_0200'); + console.info('ArkUX_Stage_TextInput_CaretPosition_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretPosition_0200 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + expect(obj.$attrs.caretPosition).assertEqual("0"); + console.info('ArkUX_Stage_TextInput_CaretPosition_0200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretPosition_0200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretPosition_0300 + *tc.name Support modifying the cursor position change of TextInput component + *tc.desc Sets the caretPosition property parameter to 7 + */ + it('ArkUX_Stage_TextInput_CaretPosition_0300', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretPosition_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretPosition_0300'); + console.info('ArkUX_Stage_TextInput_CaretPosition_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretPosition_0300 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + expect(obj.$attrs.caretPosition).assertEqual("7"); + console.info('ArkUX_Stage_TextInput_CaretPosition_0300 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretPosition_0300 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretPosition_0400 + *tc.name Support modifying the cursor position change of TextInput component + *tc.desc Sets the caretPosition property parameter to "7" + */ + it('ArkUX_Stage_TextInput_CaretPosition_0400', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretPosition_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretPosition_0400'); + console.info('ArkUX_Stage_TextInput_CaretPosition_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretPosition_0400 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + expect(obj.$attrs.caretPosition).assertEqual("7"); + console.info('ArkUX_Stage_TextInput_CaretPosition_0400 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretPosition_0400 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretPosition_0500 + *tc.name Support modifying the cursor position change of TextInput component + *tc.desc Sets the caretPosition property parameter to $r("app.string.textInput_Size_test") + */ + it('ArkUX_Stage_TextInput_CaretPosition_0500', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretPosition_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretPosition_0500'); + console.info('ArkUX_Stage_TextInput_CaretPosition_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretPosition_0500 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + expect(obj.$attrs.caretPosition).assertEqual("0"); + console.info('ArkUX_Stage_TextInput_CaretPosition_0500 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretPosition_0500 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretPosition_0600 + *tc.name Support modifying the cursor position change of TextInput component + *tc.desc Set the caretPosition property parameter to exceed the existing text length by 100 + */ + it('ArkUX_Stage_TextInput_CaretPosition_0600', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretPosition_0600 START'); + setTimeout(() => { + try { + let str = "input your word..." + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretPosition_0600'); + console.info('ArkUX_Stage_TextInput_CaretPosition_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretPosition_0600 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + expect(obj.$attrs.caretPosition != "100").assertTrue(); + expect(obj.$attrs.caretPosition).assertEqual(str.length.toString()); + console.info('ArkUX_Stage_TextInput_CaretPosition_0600 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretPosition_0600 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretPosition_0700 + *tc.name Support modifying the cursor position change of TextInput component + *tc.desc Set the caretPosition property parameter to an outlier "" + */ + it('ArkUX_Stage_TextInput_CaretPosition_0700', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretPosition_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretPosition_0700'); + console.info('ArkUX_Stage_TextInput_CaretPosition_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretPosition_0700 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + expect(obj.$attrs.caretPosition).assertEqual("0"); + console.info('ArkUX_Stage_TextInput_CaretPosition_0700 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretPosition_0700 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretPosition_0800 + *tc.name Support modifying the cursor position change of TextInput component + *tc.desc Set the caretPosition property parameter to an outlier -1 + */ + it('ArkUX_Stage_TextInput_CaretPosition_0800', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretPosition_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretPosition_0800'); + console.info('ArkUX_Stage_TextInput_CaretPosition_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretPosition_0800 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + expect(obj.$attrs.caretPosition).assertEqual("0"); + console.info('ArkUX_Stage_TextInput_CaretPosition_0800 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretPosition_0800 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretPosition_0900 + *tc.name Support modifying the cursor position change of TextInput component + *tc.desc Set the caretPosition property parameter to an outlier null + */ + it('ArkUX_Stage_TextInput_CaretPosition_0900', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretPosition_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretPosition_0900'); + console.info('ArkUX_Stage_TextInput_CaretPosition_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretPosition_0900 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + expect(obj.$attrs.caretPosition).assertEqual("0"); + console.info('ArkUX_Stage_TextInput_CaretPosition_0900 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretPosition_0900 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretPosition_1000 + *tc.name Support modifying the cursor position change of TextInput component + *tc.desc Set the caretPosition property parameter to an outlier undefined + */ + it('ArkUX_Stage_TextInput_CaretPosition_1000', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretPosition_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretPosition_1000'); + console.info('ArkUX_Stage_TextInput_CaretPosition_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretPosition_1000 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + expect(obj.$attrs.caretPosition).assertEqual("0"); + console.info('ArkUX_Stage_TextInput_CaretPosition_1000 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretPosition_1000 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretPosition_1100 + *tc.name Support modifying the cursor position change of TextInput component + *tc.desc Set the caretPosition property parameter to 7 and set the caretPosition property parameter to 3 again + */ + it('ArkUX_Stage_TextInput_CaretPosition_1100', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretPosition_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretPosition_1100'); + console.info('ArkUX_Stage_TextInput_CaretPosition_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretPosition_1100 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_TextInput_CaretPosition_1100 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + expect(obj.$attrs.caretPosition).assertEqual("3"); + console.info('ArkUX_Stage_TextInput_CaretPosition_1100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretPosition_1100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretPosition_1200 + *tc.name Support modifying the cursor position change of TextInput component + *tc.desc Set the caretPosition property parameter to 7 and set the caretPosition property + parameter to undefined again + */ + it('ArkUX_Stage_TextInput_CaretPosition_1200', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretPosition_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretPosition_1200'); + console.info('ArkUX_Stage_TextInput_CaretPosition_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretPosition_1200 component obj is: " + JSON.stringify(obj)); + console.info("ArkUX_Stage_TextInput_CaretPosition_1200 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + expect(obj.$attrs.caretPosition).assertEqual("7"); + console.info('ArkUX_Stage_TextInput_CaretPosition_1200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretPosition_1200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretPosition_1300 + *tc.name Support modifying the cursor position change of TextInput component + *tc.desc Set the caretPosition attribute parameter to 7 and the generic position attribute to null + */ + it('ArkUX_Stage_TextInput_CaretPosition_1300', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretPosition_1300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretPosition_1300'); + console.info('ArkUX_Stage_TextInput_CaretPosition_1300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretPosition_1300 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + expect(obj.$attrs.caretPosition).assertEqual("7"); + console.info('ArkUX_Stage_TextInput_CaretPosition_1300 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretPosition_1300 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretPosition_1400 + *tc.name Support modifying the cursor position change of TextInput component + *tc.desc TextInput component text text overlength setting cursor position "70" + */ + it('ArkUX_Stage_TextInput_CaretPosition_1400', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretPosition_1400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretPosition_1400'); + console.info('ArkUX_Stage_TextInput_CaretPosition_1400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretPosition_1400 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + expect(obj.$attrs.caretPosition).assertEqual("70"); + console.info('ArkUX_Stage_TextInput_CaretPosition_1400 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretPosition_1400 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretWidth_0100 + *tc.name Support modifying the cursor thickness of TextInput component + *tc.desc Set the caretWidth property parameter to 0 + */ + it('ArkUX_Stage_TextInput_CaretWidth_0100', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretWidth_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretWidth_0100'); + console.info('ArkUX_Stage_TextInput_CaretWidth_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretWidth_0100 component obj.$attrs.caretWidth is: " + + JSON.stringify(obj.$attrs.caretWidth)); + console.info("ArkUX_Stage_TextInput_CaretWidth_0100 component obj.$attrs.caretStyle is: " + + JSON.stringify(obj.$attrs.caretStyle)); + let cursorStyle = JSON.parse(obj.$attrs.caretStyle); + expect(cursorStyle.caretWidth).assertEqual("0.00vp"); + console.info('ArkUX_Stage_TextInput_CaretWidth_0100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretWidth_0100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretWidth_0200 + *tc.name Support modifying the cursor thickness of TextInput component + *tc.desc Set the caretWidth property parameter to 7 + */ + it('ArkUX_Stage_TextInput_CaretWidth_0200', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretWidth_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretWidth_0200'); + console.info('ArkUX_Stage_TextInput_CaretWidth_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretWidth_0200 component obj.$attrs.caretStyle is: " + + JSON.stringify(obj.$attrs.caretStyle)); + let cursorStyle = JSON.parse(obj.$attrs.caretStyle); + expect(cursorStyle.caretWidth).assertEqual("7.00vp"); + console.info('ArkUX_Stage_TextInput_CaretWidth_0200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretWidth_0200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretWidth_0300 + *tc.name Support modifying the cursor thickness of TextInput component + *tc.desc Set the caretWidth property parameter to "7vp" + */ + it('ArkUX_Stage_TextInput_CaretWidth_0300', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretWidth_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretWidth_0300'); + console.info('ArkUX_Stage_TextInput_CaretWidth_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretWidth_0300 component obj.$attrs.caretStyle is: " + + JSON.stringify(obj.$attrs.caretStyle)); + let cursorStyle = JSON.parse(obj.$attrs.caretStyle); + expect(cursorStyle.caretWidth).assertEqual("7.00vp"); + console.info('ArkUX_Stage_TextInput_CaretWidth_0300 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretWidth_0300 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretWidth_0400 + *tc.name Support modifying the cursor thickness of TextInput component + *tc.desc Set the caretWidth property parameter to $r("app.string.textInput_Size_test") + */ + it('ArkUX_Stage_TextInput_CaretWidth_0400', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretWidth_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretWidth_0400'); + console.info('ArkUX_Stage_TextInput_CaretWidth_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretWidth_0400 component obj.$attrs.caretStyle is: " + + JSON.stringify(obj.$attrs.caretStyle)); + let cursorStyle = JSON.parse(obj.$attrs.caretStyle); + expect(cursorStyle.caretWidth).assertEqual("4.00px"); + console.info('ArkUX_Stage_TextInput_CaretWidth_0400 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretWidth_0400 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretWidth_0500 + *tc.name Support modifying the cursor thickness of TextInput component + *tc.desc Set the caretWidth property parameter to outlier -1 + */ + it('ArkUX_Stage_TextInput_CaretWidth_0500', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretWidth_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretWidth_0500'); + console.info('ArkUX_Stage_TextInput_CaretWidth_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretWidth_0500 component obj.$attrs.caretStyle is: " + + JSON.stringify(obj.$attrs.caretStyle)); + let cursorStyle = JSON.parse(obj.$attrs.caretStyle); + expect(cursorStyle.caretWidth).assertEqual("1.50vp"); + console.info('ArkUX_Stage_TextInput_CaretWidth_0500 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretWidth_0500 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretWidth_0600 + *tc.name Support modifying the cursor thickness of TextInput component + *tc.desc Set the caretWidth property parameter to outlier "" + */ + it('ArkUX_Stage_TextInput_CaretWidth_0600', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretWidth_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretWidth_0600'); + console.info('ArkUX_Stage_TextInput_CaretWidth_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretWidth_0600 component obj.$attrs.caretStyle is: " + + JSON.stringify(obj.$attrs.caretStyle)); + let cursorStyle = JSON.parse(obj.$attrs.caretStyle); + expect(cursorStyle.caretWidth).assertEqual("0.00vp"); + console.info('ArkUX_Stage_TextInput_CaretWidth_0600 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretWidth_0600 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretWidth_0700 + *tc.name Support modifying the cursor thickness of TextInput component + *tc.desc Set the caretWidth property parameter to outlier null + */ + it('ArkUX_Stage_TextInput_CaretWidth_0700', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretWidth_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretWidth_0700'); + console.info('ArkUX_Stage_TextInput_CaretWidth_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretWidth_0700 component obj.$attrs.caretStyle is: " + + JSON.stringify(obj.$attrs.caretStyle)); + let cursorStyle = JSON.parse(obj.$attrs.caretStyle); + expect(cursorStyle.caretWidth).assertEqual("1.50vp"); + console.info('ArkUX_Stage_TextInput_CaretWidth_0700 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretWidth_0700 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretWidth_0800 + *tc.name Support modifying the cursor thickness of TextInput component + *tc.desc Set the caretWidth property parameter to outlier undefined + */ + it('ArkUX_Stage_TextInput_CaretWidth_0800', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretWidth_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretWidth_0800'); + console.info('ArkUX_Stage_TextInput_CaretWidth_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretWidth_0800 component obj.$attrs.caretStyle is: " + + JSON.stringify(obj.$attrs.caretStyle)); + let cursorStyle = JSON.parse(obj.$attrs.caretStyle); + expect(cursorStyle.caretWidth).assertEqual("1.50vp"); + console.info('ArkUX_Stage_TextInput_CaretWidth_0800 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretWidth_0800 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretWidth_0900 + *tc.name Support modifying the cursor thickness of TextInput component + *tc.desc Set the caretWidth property parameter to outlier "asff%6&" + */ + it('ArkUX_Stage_TextInput_CaretWidth_0900', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretWidth_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretWidth_0900'); + console.info('ArkUX_Stage_TextInput_CaretWidth_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretWidth_0900 component obj.$attrs.caretStyle is: " + + JSON.stringify(obj.$attrs.caretStyle)); + let cursorStyle = JSON.parse(obj.$attrs.caretStyle); + expect(cursorStyle.caretWidth).assertEqual("0.00vp"); + console.info('ArkUX_Stage_TextInput_CaretWidth_0900 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretWidth_0900 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretWidth_1000 + *tc.name Support modifying the cursor thickness of TextInput component + *tc.desc Set the caretWidth property parameter to 7 and set the caretWidth property parameter to "2fp" again + */ + it('ArkUX_Stage_TextInput_CaretWidth_1000', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretWidth_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretWidth_1000'); + console.info('ArkUX_Stage_TextInput_CaretWidth_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretWidth_1000 component obj.$attrs.caretStyle is: " + + JSON.stringify(obj.$attrs.caretStyle)); + let cursorStyle = JSON.parse(obj.$attrs.caretStyle); + expect(cursorStyle.caretWidth).assertEqual("2.00fp"); + console.info('ArkUX_Stage_TextInput_CaretWidth_1000 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretWidth_1000 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretWidth_1100 + *tc.name Support modifying the cursor thickness of TextInput component + *tc.desc Set the caretWidth property parameter to 7 and set the caretWidth property parameter to undefined again + */ + it('ArkUX_Stage_TextInput_CaretWidth_1100', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretWidth_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretWidth_1100'); + console.info('ArkUX_Stage_TextInput_CaretWidth_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretWidth_1100 component obj.$attrs.caretStyle is: " + + JSON.stringify(obj.$attrs.caretStyle)); + let cursorStyle = JSON.parse(obj.$attrs.caretStyle); + expect(cursorStyle.caretWidth).assertEqual("1.50vp"); + console.info('ArkUX_Stage_TextInput_CaretWidth_1100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretWidth_1100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_CaretWidth_1200 + *tc.name Support modifying the cursor thickness of TextInput component + *tc.desc Set the caretWidth property parameter to "7lpx" and the common property width property to null + */ + it('ArkUX_Stage_TextInput_CaretWidth_1200', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_CaretWidth_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_CaretWidth_1200'); + console.info('ArkUX_Stage_TextInput_CaretWidth_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_CaretWidth_1200 component obj.$attrs.caretStyle is: " + + JSON.stringify(obj.$attrs.caretStyle)); + let cursorStyle = JSON.parse(obj.$attrs.caretStyle); + expect(cursorStyle.caretWidth).assertEqual("7.00lpx"); + console.info('ArkUX_Stage_TextInput_CaretWidth_1200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_CaretWidth_1200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_selectedColor_0100 + *tc.name Support to modify the color of the selected base plate of the TextInput component + *tc.desc Set the selectedColor property parameter to 0x00ff00 + */ + it('ArkUX_Stage_TextInput_selectedColor_0100', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_selectedColor_0100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_selectedColor_0100'); + console.info('ArkUX_Stage_TextInput_selectedColor_0100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_selectedColor_0100 component obj.$attrs.selectedBackgroundColor is: " + + JSON.stringify(obj.$attrs.selectedBackgroundColor)); + expect(obj.$attrs.selectedBackgroundColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_TextInput_selectedColor_0100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_selectedColor_0100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_selectedColor_0200 + *tc.name Support to modify the color of the selected base plate of the TextInput component + *tc.desc Set the selectedColor property parameter to #fffd0000 + */ + it('ArkUX_Stage_TextInput_selectedColor_0200', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_selectedColor_0200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_selectedColor_0200'); + console.info('ArkUX_Stage_TextInput_selectedColor_0200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_selectedColor_0200 component obj.$attrs.selectedBackgroundColor is: " + + JSON.stringify(obj.$attrs.selectedBackgroundColor)); + expect(obj.$attrs.selectedBackgroundColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_TextInput_selectedColor_0200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_selectedColor_0200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_selectedColor_0300 + *tc.name Support to modify the color of the selected base plate of the TextInput component + *tc.desc Set the selectedColor property parameter to 'rgb(138,43,226)' + */ + it('ArkUX_Stage_TextInput_selectedColor_0300', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_selectedColor_0300 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_selectedColor_0300'); + console.info('ArkUX_Stage_TextInput_selectedColor_0300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_selectedColor_0300 component obj.$attrs.selectedBackgroundColor is: " + + JSON.stringify(obj.$attrs.selectedBackgroundColor)); + expect(obj.$attrs.selectedBackgroundColor).assertEqual("#FF8A2BE2"); + console.info('ArkUX_Stage_TextInput_selectedColor_0300 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_selectedColor_0300 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_selectedColor_040 + *tc.name Support to modify the color of the selected base plate of the TextInput component + *tc.desc Set the selectedColor property parameter to Color.Pink + */ + it('ArkUX_Stage_TextInput_selectedColor_0400', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_selectedColor_0400 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_selectedColor_0400'); + console.info('ArkUX_Stage_TextInput_selectedColor_0400 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_selectedColor_0400 component obj.$attrs.selectedBackgroundColor is: " + + JSON.stringify(obj.$attrs.selectedBackgroundColor)); + expect(obj.$attrs.selectedBackgroundColor).assertEqual("#FFFFC0CB"); + console.info('ArkUX_Stage_TextInput_selectedColor_0400 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_selectedColor_0400 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_selectedColor_0500 + *tc.name Support to modify the color of the selected base plate of the TextInput component + *tc.desc Set the selectedColor property parameter to $r("app.color.TextInput_Color") + */ + it('ArkUX_Stage_TextInput_selectedColor_0500', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_selectedColor_0500 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_selectedColor_0500'); + console.info('ArkUX_Stage_TextInput_selectedColor_0500 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_selectedColor_0500 component obj.$attrs.selectedBackgroundColor is: " + + JSON.stringify(obj.$attrs.selectedBackgroundColor)); + expect(obj.$attrs.selectedBackgroundColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_TextInput_selectedColor_0500 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_selectedColor_0500 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_selectedColor_0600 + *tc.name Support to modify the color of the selected base plate of the TextInput component + *tc.desc Set the selectedColor property parameter to an outlier "" + */ + it('ArkUX_Stage_TextInput_selectedColor_0600', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_selectedColor_0600 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_selectedColor_0600'); + console.info('ArkUX_Stage_TextInput_selectedColor_0600 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_selectedColor_0600 component obj.$attrs.selectedBackgroundColor is: " + + JSON.stringify(obj.$attrs.selectedBackgroundColor)); + expect(obj.$attrs.selectedBackgroundColor).assertEqual("#33007DFF"); + console.info('ArkUX_Stage_TextInput_selectedColor_0600 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_selectedColor_0600 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_selectedColor_0700 + *tc.name Support to modify the color of the selected base plate of the TextInput component + *tc.desc Set the selectedColor property parameter to an outlier null + */ + it('ArkUX_Stage_TextInput_selectedColor_0700', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_selectedColor_0700 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_selectedColor_0700'); + console.info('ArkUX_Stage_TextInput_selectedColor_0700 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_selectedColor_0700 component obj.$attrs.selectedBackgroundColor is: " + + JSON.stringify(obj.$attrs.selectedBackgroundColor)); + expect(obj.$attrs.selectedBackgroundColor).assertEqual("#33007DFF"); + console.info('ArkUX_Stage_TextInput_selectedColor_0700 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_selectedColor_0700 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_selectedColor_0800 + *tc.name Support to modify the color of the selected base plate of the TextInput component + *tc.desc Set the selectedColor property parameter to an outlier undefined + */ + it('ArkUX_Stage_TextInput_selectedColor_0800', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_selectedColor_0800 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_selectedColor_0800'); + console.info('ArkUX_Stage_TextInput_selectedColor_0800 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_selectedColor_0800 component obj.$attrs.selectedBackgroundColor is: " + + JSON.stringify(obj.$attrs.selectedBackgroundColor)); + expect(obj.$attrs.selectedBackgroundColor).assertEqual("#33007DFF"); + console.info('ArkUX_Stage_TextInput_selectedColor_0800 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_selectedColor_0800 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_selectedColor_0900 + *tc.name Support to modify the color of the selected base plate of the TextInput component + *tc.desc Set the selectedColor property parameter to Color.Pink and + * again set the selectedColor property parameter to "#FFFD0000". + */ + it('ArkUX_Stage_TextInput_selectedColor_0900', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_selectedColor_0900 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_selectedColor_0900'); + console.info('ArkUX_Stage_TextInput_selectedColor_0900 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_selectedColor_0900 component obj.$attrs.selectedBackgroundColor is: " + + JSON.stringify(obj.$attrs.selectedBackgroundColor)); + expect(obj.$attrs.selectedBackgroundColor).assertEqual("#FFFD0000"); + console.info('ArkUX_Stage_TextInput_selectedColor_0900 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_selectedColor_0900 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_selectedColor_1000 + *tc.name Support to modify the color of the selected base plate of the TextInput component + *tc.desc Set the selectedColor property parameter to Color.Pink and + * again set the selectedColor property parameter to the outlier undefined. + */ + it('ArkUX_Stage_TextInput_selectedColor_1000', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_selectedColor_1000 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_selectedColor_1000'); + console.info('ArkUX_Stage_TextInput_selectedColor_1000 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_selectedColor_1000 component obj.$attrs.selectedBackgroundColor is: " + + JSON.stringify(obj.$attrs.selectedBackgroundColor)); + expect(obj.$attrs.selectedBackgroundColor).assertEqual("#33007DFF"); + console.info('ArkUX_Stage_TextInput_selectedColor_1000 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_selectedColor_1000 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_selectedColor_1100 + *tc.name Support to modify the color of the selected base plate of the TextInput component + *tc.desc Set the selectedColor property parameter to 0x00ff00 and + * the universal property backgroundColor property to the outlier null + */ + it('ArkUX_Stage_TextInput_selectedColor_1100', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_selectedColor_1100 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_selectedColor_1100'); + console.info('ArkUX_Stage_TextInput_selectedColor_1100 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_selectedColor_1100 component obj.$attrs.selectedBackgroundColor is: " + + JSON.stringify(obj.$attrs.selectedBackgroundColor)); + expect(obj.$attrs.selectedBackgroundColor).assertEqual("#FF00FF00"); + console.info('ArkUX_Stage_TextInput_selectedColor_1100 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_selectedColor_1100 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_selectedColor_1200 + *tc.name Combined test all new attributes of textinput component + *tc.desc Set .selectedBackgroundColor(0x00ff00).caretWidth(7).caretPosition(4) + */ + it('ArkUX_Stage_TextInput_selectedColor_1200', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_selectedColor_1200 START'); + setTimeout(() => { + try { + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_selectedColor_1200'); + console.info('ArkUX_Stage_TextInput_selectedColor_1200 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_selectedColor_1200 component obj.$attrs.selectedBackgroundColor is: " + + JSON.stringify(obj.$attrs.selectedBackgroundColor)); + console.info("ArkUX_Stage_TextInput_selectedColor_1200 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + console.info("ArkUX_Stage_TextInput_selectedColor_1200 component obj.$attrs.caretStyle is: " + + JSON.stringify(obj.$attrs.caretStyle)); + let cursorStyle = JSON.parse(obj.$attrs.caretStyle); + expect(obj.$attrs.selectedBackgroundColor).assertEqual("#FF00FF00"); + expect(obj.$attrs.caretPosition).assertEqual("4"); + expect(cursorStyle.caretWidth).assertEqual("7.00vp"); + console.info('ArkUX_Stage_TextInput_selectedColor_1200 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_selectedColor_1200 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + + /* + *tc.number ArkUX_Stage_TextInput_selectedColor_1300 + *tc.name Combined test all new attributes of textinput component + *tc.desc Do not set new attributes + */ + it('ArkUX_Stage_TextInput_selectedColor_1300', 0, async function (done) { + console.info('ArkUX_Stage_TextInput_selectedColor_1300 START'); + setTimeout(() => { + try { + let str = "input your word..." + let strJson = getInspectorByKey('ArkUX_Stage_TextInput_selectedColor_1300'); + console.info('ArkUX_Stage_TextInput_selectedColor_1300 START :' + JSON.stringify(strJson)); + let obj = JSON.parse(strJson); + console.info("ArkUX_Stage_TextInput_selectedColor_1300 component obj.$attrs.selectedBackgroundColor is: " + + JSON.stringify(obj.$attrs.selectedBackgroundColor)); + console.info("ArkUX_Stage_TextInput_selectedColor_1300 component obj.$attrs.caretPosition is: " + + JSON.stringify(obj.$attrs.caretPosition)); + console.info("ArkUX_Stage_TextInput_selectedColor_1300 component obj.$attrs.caretStyle is: " + + JSON.stringify(obj.$attrs.caretStyle)); + let cursorStyle = JSON.parse(obj.$attrs.caretStyle); + expect(obj.$attrs.selectedBackgroundColor).assertEqual("#33007DFF"); + expect(obj.$attrs.caretPosition).assertEqual("0"); + expect(cursorStyle.caretWidth).assertEqual("1.50vp"); + console.info('ArkUX_Stage_TextInput_selectedColor_1300 END '); + } catch (err) { + expect().assertFail(); + console.info('ArkUX_Stage_TextInput_selectedColor_1300 ERR ' + JSON.stringify(err)); + } + done(); + }, 500) + }); + }) +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/module.json b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..2b03fde2a1898cf911b3b3f2f94a553bca8ebb86 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/module.json @@ -0,0 +1,41 @@ +{ + "module": { + "name": "phone", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "visible": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/resources/base/element/color.json b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..586382563057582bb7de7372322564c1487fece1 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/resources/base/element/color.json @@ -0,0 +1,16 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "Divider_color", + "value": "#000000" + }, + { + "name": "TextInput_Color", + "value": "#FFFD0000" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..aa4851556c0d6ba3c28f36f26f718eb64e1b0e9b --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + }, + { + "name": "Divider_width", + "value": "10px" + }, + { + "name": "Divider_startMargin", + "value": "5px" + }, + { + "name": "Divider_endMargin", + "value": "5px" + }, + { + "name": "textInput_Size_test", + "value": "4px" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/resources/base/media/icon.png b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/resources/base/media/icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/resources/base/profile/test_pages.json b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/resources/base/profile/test_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..77e90731b5a38d861663029b483df3d3ac9ec74b --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "TestAbility/pages/Index" + ] +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/AppScope/app.json b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..9b225e81a3d95cc698bb7966731d65d5132a79f9 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/AppScope/app.json @@ -0,0 +1,19 @@ +{ + "app": { + "bundleName": "com.example.acetextpickertest", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/AppScope/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..30af7cfee6766dda361b893d1565490dc145fdf0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"MyApplication" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/AppScope/resources/base/media/app_icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/BUILD.gn b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..7afe2e20889181f93c5e8d108947ef72eea58f97 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/BUILD.gn @@ -0,0 +1,43 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAceTextPickerTest") { + hap_profile = "src/main/module.json" + js_build_mode = "debug" + deps = [ + ":ace_ets_component_textpicker_js_assets", + ":ace_ets_component_textpicker_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsAceTextPickerTest" + part_name = "ace_engine" + subsystem_name = "arkui" +} + +ohos_app_scope("ace_ets_component_textpicker_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("ace_ets_component_textpicker_js_assets") { + source_dir = "src/main/ets" +} + +ohos_resources("ace_ets_component_textpicker_resources") { + sources = [ "src/main/resources" ] + deps = [ ":ace_ets_component_textpicker_profile" ] + hap_profile = "src/main/module.json" +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/Test.json b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..264b4aed77f2680a1d35a191a65fc0dfe0a632d3 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/Test.json @@ -0,0 +1,26 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "600000", + "bundle-name": "com.example.acetextpickertest", + "module-name": "phone", + "shell-timeout": "600000", + "testcase-timeout": 70000 + }, + "kits": [{ + "test-file-name": [ + "ActsAceTextPickerTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "power-shell wakeup", + "power-shell setmode 602" + ] + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/signature/openharmony_sx.p7b b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..fb7bf259a4ed090ce0b1541592c5bee473c7fe0d Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/signature/openharmony_sx.p7b differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/TestAbility/TestAbility.ets b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/TestAbility/TestAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..fc4e92b3ab3bfcf55c6562ba538d672cfa9458f0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/TestAbility/TestAbility.ets @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import hilog from '@ohos.hilog'; +import Ability from '@ohos.app.ability.UIAbility' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import testsuite from '../test/List.test' +import Window from '@ohos.window' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('TestAbility/pages/Index', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/TestAbility/pages/Index.ets b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/TestAbility/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..7da329e19bd60e5948fd381b6eb9082423ec3b40 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/TestAbility/pages/Index.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import hilog from '@ohos.hilog'; +import testsuite from '../../test/List.test' +@Entry +@Component +struct TextPickerExample { + + @State select: number = 1 + private multipleColumns: TextPickerRangeContent[] = [{icon: $r('app.media.icon'), text:'apple1'}, {icon:$r('app.media.icon'), text:'orange2'}, {icon:$r('app.media.icon'), text:'peach3'}, + {icon:$r('app.media.icon'), text:'grape4'}, {icon:$r('app.media.icon'), text:'grape5'}] + + @State disappearTextStyle: PickerTextStyle = {color:Color.Black,font:{size:8,weight:FontWeight.Lighter}} + @State textStyle: PickerTextStyle = {color:Color.Red,font:{size:'10px',weight:FontWeight.Normal}} + @State selectedTextStyle: PickerTextStyle = {color:Color.Blue,font:{size:'20px',weight:FontWeight.Bold}} + + + private stateChangCallBack = (eventData) => { + console.info("select page state change called:" + JSON.stringify(eventData)); + if (eventData != null) { + if (eventData.data.disappearTextStyle != null) { + this.disappearTextStyle = JSON.parse(eventData.data.disappearTextStyle); + } + if (eventData.data.textStyle != null) { + this.textStyle = JSON.parse(eventData.data.textStyle); + } + if (eventData.data.selectedTextStyle != null) { + this.selectedTextStyle = JSON.parse(eventData.data.selectedTextStyle); + } + } + } + + aboutToAppear(){ + var stateChangeEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + events_emitter.on(stateChangeEvent, this.stateChangCallBack); + + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + build() { + Column() { + TextPicker({range: this.multipleColumns,selected: this.select}) + .disappearTextStyle(this.disappearTextStyle) + .textStyle(this.textStyle) + .selectedTextStyle(this.selectedTextStyle) + .key('textPicker') + .onChange((value: string, index: number) => { + console.info('Picker item changed, value: ' + value + ', index: ' + index) + }) + } + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6c662824093f9339085214d247c6247faa86ae9 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s it', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${targetParams} ${key} ${parameters[key]}` + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/test/List.test.ets b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..4ad13128ddb492654ba723f3f5cd0895f3a4ae71 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/test/List.test.ets @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import textpicker from './TextPicker' + +export default function testsuite() { + textpicker() + +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/test/TextPicker.ets b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/test/TextPicker.ets new file mode 100644 index 0000000000000000000000000000000000000000..59ac1ddd8bb72228540aaf9cfb442bd88775e7d1 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/test/TextPicker.ets @@ -0,0 +1,856 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// @ts-nocheck +import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' +import events_emitter from '@ohos.events.emitter'; +import Utils from './Utils.ets'; +export default function textpicker() { + describe('ActsAceTextPickerTest', function () { + beforeEach(async function (done) { + await Utils.sleep(2000); + console.info("textPicker beforeEach start"); + done(); + }) + + afterEach(async function (done) { + console.info("textPicker afterEach start"); + try { + var eventData = { + data: { + "disappearTextStyle": {color:Color.Black,font:{size:8,weight:FontWeight.Lighter}}, + "textStyle": {color:Color.Red,font:{size:'10px',weight:FontWeight.Normal}}, + "selectedTextStyle": {color:Color.Blue,font:{size:'20px',weight:FontWeight.Bold}} + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[textPicker_afterEach] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[selectTest_afterEach] change component data error: " + err.message); + } + done(); + }) + + /* + * @tc.number ArkUI_Stage_textpicker_disappearTextStyle_0001 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc get the default value + */ + it('ArkUI_Stage_textpicker_disappearTextStyle_0001', 0, async function (done) { + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_disappearTextStyle_0001] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF000000'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('8.00fp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Lighter'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_disappearTextStyle_0002 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_disappearTextStyle_0002', 0, async function (done) { + let value = {color:Color.Black,font:{size:8,weight:FontWeight.Bolder}} + try { + var eventData = { + data: { + "disappearTextStyle":JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_disappearTextStyle_0002] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_disappearTextStyle_0002] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.error("[ArkUI_Stage_textpicker_disappearTextStyle_0002] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF000000'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('8.00fp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Bolder'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_disappearTextStyle_0003 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_disappearTextStyle_0003', 0, async function (done) { + let value = {color:0x808080,font:{size:8,weight:100}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_disappearTextStyle_0003] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_disappearTextStyle_0003] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_disappearTextStyle_0003] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF808080'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('8.00fp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('100'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_disappearTextStyle_0004 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_disappearTextStyle_0004', 0, async function (done) { + let value = {color:'#ff0000',font:{size:'1px',weight:'700'}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_disappearTextStyle_0004] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_disappearTextStyle_0004] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_disappearTextStyle_0004] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FFFF0000'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('1.00px'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('700'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_disappearTextStyle_0005 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_disappearTextStyle_0005', 0, async function (done) { + let value = {color:Color.Green,font:{size:30,weight:450}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_disappearTextStyle_0005] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_disappearTextStyle_0005] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_disappearTextStyle_0005] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF008000'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('30.00fp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_disappearTextStyle_0006 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_disappearTextStyle_0006', 0, async function (done) { + let value = {color:'#80808g',font:{size:-1,weight:1000}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_disappearTextStyle_0006] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_disappearTextStyle_0006] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_disappearTextStyle_0006] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF182431'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('14.00vp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_disappearTextStyle_0007 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_disappearTextStyle_0007', 0, async function (done) { + let value = {color:'xxx',font:{size:'xxx',weight:FontWeight.Bold}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_disappearTextStyle_0007] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_disappearTextStyle_0007] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_disappearTextStyle_0007] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF182431'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('14.00vp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Bold'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_disappearTextStyle_0008 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_disappearTextStyle_0008', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'20vp',weight:900}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_disappearTextStyle_0008] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_disappearTextStyle_0008] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('20.00vp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('900'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_disappearTextStyle_0009 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_disappearTextStyle_0009', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'15lpx',weight:90}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_disappearTextStyle_0009] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_disappearTextStyle_0009] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('15.00lpx'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_textStyle_0001 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc get the default value + */ + it('ArkUI_Stage_textpicker_textStyle_0001', 0, async function (done) { + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_textStyle_0001] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FFFF0000'); + expect(obj.$attrs.textStyle.font.size).assertEqual('10.00px'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_textStyle_0002 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_textpicker_textStyle_0002', 0, async function (done) { + let value = {color:Color.Red,font:{size:'10px',weight:FontWeight.Bolder}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_textStyle_0002] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_textStyle_0002] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.error("[ArkUI_Stage_textpicker_textStyle_0002] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FFFF0000'); + expect(obj.$attrs.textStyle.font.size).assertEqual('10.00px'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Bolder'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_textStyle_0003 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_textpicker_textStyle_0003', 0, async function (done) { + let value = {color:0xFF808080,font:{size:'10px',weight:100}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_textStyle_0003] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_textStyle_0003] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_textStyle_0003] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FF808080'); + expect(obj.$attrs.textStyle.font.size).assertEqual('10.00px'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('100'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_textStyle_0004 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_textpicker_textStyle_0004', 0, async function (done) { + let value = {color:'#00ff00',font:{size:'1px',weight:'700'}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_textStyle_0004] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_textStyle_0004] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_textStyle_0004] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FF00FF00'); + expect(obj.$attrs.textStyle.font.size).assertEqual('1.00px'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('700'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_textStyle_0005 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_textpicker_textStyle_0005', 0, async function (done) { + let value = {color:Color.Green,font:{size:30,weight:450}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_textStyle_0005] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_textStyle_0005] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_textStyle_0005] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FF008000'); + expect(obj.$attrs.textStyle.font.size).assertEqual('30.00fp'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_textStyle_0006 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_textpicker_textStyle_0006', 0, async function (done) { + let value = {color:'#80808g',font:{size:-1,weight:1000}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_textStyle_0006] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_textStyle_0006] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_textStyle_0006] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FF182431'); + expect(obj.$attrs.textStyle.font.size).assertEqual('16.00vp'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_textStyle_0007 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_textpicker_textStyle_0007', 0, async function (done) { + let value = {color:'xxx',font:{size:'xxx',weight:FontWeight.Lighter}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_textStyle_0007] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_textStyle_0007] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_textStyle_0007] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FF182431'); + expect(obj.$attrs.textStyle.font.size).assertEqual('16.00vp'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Lighter'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_textStyle_0008 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_textpicker_textStyle_0008', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'20vp',weight:900}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_textStyle_0008] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_textStyle_0008] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.textStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.textStyle.font.size).assertEqual('20.00vp'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('900'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_textStyle_0009 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_textpicker_textStyle_0009', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'15lpx',weight:90}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_textStyle_0009] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_textStyle_0009] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.textStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.textStyle.font.size).assertEqual('15.00lpx'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_selectedTextStyle_0001 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc get the default value + */ + it('ArkUI_Stage_textpicker_selectedTextStyle_0001', 0, async function (done) { + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_selectedTextStyle_0001] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF0000FF'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00px'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Bold'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_selectedTextStyle_0002 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_selectedTextStyle_0002', 0, async function (done) { + let value = {color:Color.Blue,font:{size:'20px',weight:FontWeight.Bolder}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_selectedTextStyle_0002] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_selectedTextStyle_0002] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.error("[ArkUI_Stage_textpicker_selectedTextStyle_0002] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF0000FF'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00px'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Bolder'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_selectedTextStyle_0003 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_selectedTextStyle_0003', 0, async function (done) { + let value = {color:0xFF808080,font:{size:'20px',weight:100}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_selectedTextStyle_0003] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_selectedTextStyle_0003] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_selectedTextStyle_0003] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF808080'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00px'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('100'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_selectedTextStyle_0004 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_selectedTextStyle_0004', 0, async function (done) { + let value = {color:'#00ff00',font:{size:'1px',weight:'700'}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_selectedTextStyle_0004] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_selectedTextStyle_0004] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_selectedTextStyle_0004] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF00FF00'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('1.00px'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('700'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_selectedTextStyle_0005 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_selectedTextStyle_0005', 0, async function (done) { + let value = {color:Color.Green,font:{size:30,weight:450}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_selectedTextStyle_0005] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_selectedTextStyle_0005] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_selectedTextStyle_0005] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF008000'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('30.00fp'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_selectedTextStyle_0006 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_selectedTextStyle_0006', 0, async function (done) { + let value = {color:'#80808g',font:{size:-1,weight:1000}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_selectedTextStyle_0006] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_selectedTextStyle_0006] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_selectedTextStyle_0006] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF007DFF'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00vp'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_selectedTextStyle_0007 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_selectedTextStyle_0007', 0, async function (done) { + let value = {color:'xxx',font:{size:'xxx',weight:FontWeight.Lighter}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_selectedTextStyle_0007] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_selectedTextStyle_0007] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_textpicker_selectedTextStyle_0007] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF007DFF'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00vp'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Lighter'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_selectedTextStyle_0008 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_selectedTextStyle_0008', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'20vp',weight:900}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_selectedTextStyle_0008] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_selectedTextStyle_0008] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00vp'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('900'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_textpicker_selectedTextStyle_0009 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_textpicker_selectedTextStyle_0009', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'15lpx',weight:90}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 183, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_textpicker_selectedTextStyle_0009] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_textpicker_selectedTextStyle_0009] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('textPicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('15.00lpx'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + }) + } diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/test/Utils.ets b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/test/Utils.ets new file mode 100644 index 0000000000000000000000000000000000000000..6fecbfe80e6e5a3882dac77004efbc26a7faefea --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/test/Utils.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default class Utils { + static sleep(time){ + return new Promise((resolve,reject)=>{ + setTimeout(()=>{ + resolve("ok") + },time) + }).then(()=>{ + console.info(`sleep ${time} over...`) + }) + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/module.json b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..2b03fde2a1898cf911b3b3f2f94a553bca8ebb86 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/module.json @@ -0,0 +1,41 @@ +{ + "module": { + "name": "phone", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "visible": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/resources/base/element/color.json b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..65d8fa5a7cf54aa3943dcd0214f58d1771bc1f6c --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/resources/base/media/icon.png b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/resources/base/media/icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/resources/base/profile/test_pages.json b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/resources/base/profile/test_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..77e90731b5a38d861663029b483df3d3ac9ec74b --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "TestAbility/pages/Index" + ] +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/AppScope/app.json b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..7e79a1b45f929765d872f1712cc82f1dc58d404d --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/AppScope/app.json @@ -0,0 +1,19 @@ +{ + "app": { + "bundleName": "com.example.acetimepickertest", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/AppScope/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..30af7cfee6766dda361b893d1565490dc145fdf0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"MyApplication" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/AppScope/resources/base/media/app_icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/BUILD.gn b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..5bdf9a3cc76468a594d78a57586d96f6d3ef6da7 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/BUILD.gn @@ -0,0 +1,43 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAceTimePickerTest") { + hap_profile = "src/main/module.json" + js_build_mode = "debug" + deps = [ + ":ace_ets_component_timepicker_js_assets", + ":ace_ets_component_timepicker_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsAceTimePickerTest" + part_name = "ace_engine" + subsystem_name = "arkui" +} + +ohos_app_scope("ace_ets_component_timepicker_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("ace_ets_component_timepicker_js_assets") { + source_dir = "src/main/ets" +} + +ohos_resources("ace_ets_component_timepicker_resources") { + sources = [ "src/main/resources" ] + deps = [ ":ace_ets_component_timepicker_profile" ] + hap_profile = "src/main/module.json" +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/Test.json b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..0bdb7f468d7f37d2935edf91a8dd38ec60ef4223 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/Test.json @@ -0,0 +1,26 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "600000", + "bundle-name": "com.example.acetimepickertest", + "module-name": "phone", + "shell-timeout": "600000", + "testcase-timeout": 70000 + }, + "kits": [{ + "test-file-name": [ + "ActsAceTimePickerTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "power-shell wakeup", + "power-shell setmode 602" + ] + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/signature/openharmony_sx.p7b b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..da5a349508874a8def26346e1dcdc80afbe2cef0 Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/signature/openharmony_sx.p7b differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/TestAbility/TestAbility.ets b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/TestAbility/TestAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..fc4e92b3ab3bfcf55c6562ba538d672cfa9458f0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/TestAbility/TestAbility.ets @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import hilog from '@ohos.hilog'; +import Ability from '@ohos.app.ability.UIAbility' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import testsuite from '../test/List.test' +import Window from '@ohos.window' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('TestAbility/pages/Index', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/TestAbility/pages/Index.ets b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/TestAbility/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..c39c763894ca6c1140fd7dada9427823c44351e0 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/TestAbility/pages/Index.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import hilog from '@ohos.hilog'; +import testsuite from '../../test/List.test' +@Entry +@Component +struct TimePickerExample { + + private selectedTime: Date = new Date('2022-07-22T08:00:00') + + @State disappearTextStyle: PickerTextStyle = {color:Color.Black,font:{size:8,weight:FontWeight.Lighter}} + @State textStyle: PickerTextStyle = {color:Color.Red,font:{size:'10px',weight:FontWeight.Normal}} + @State selectedTextStyle: PickerTextStyle = {color:Color.Blue,font:{size:'20px',weight:FontWeight.Bold}} + + private stateChangCallBack = (eventData) => { + console.info("select page state change called:" + JSON.stringify(eventData)); + if (eventData != null) { + if (eventData.data.disappearTextStyle != null) { + this.disappearTextStyle = JSON.parse(eventData.data.disappearTextStyle); + } + if (eventData.data.textStyle != null) { + this.textStyle = JSON.parse(eventData.data.textStyle); + } + if (eventData.data.selectedTextStyle != null) { + this.selectedTextStyle = JSON.parse(eventData.data.selectedTextStyle); + } + } + } + + aboutToAppear(){ + var stateChangeEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + events_emitter.on(stateChangeEvent, this.stateChangCallBack); + + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + build() { + Column() { + TimePicker({selected: this.selectedTime}) + .disappearTextStyle(this.disappearTextStyle) + .textStyle(this.textStyle) + .selectedTextStyle(this.selectedTextStyle) + .key('timePicker') + .onChange((date: TimePickerResult) => { + console.info('select current date is: ' + JSON.stringify(date)) + }) + } + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6c662824093f9339085214d247c6247faa86ae9 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s it', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${targetParams} ${key} ${parameters[key]}` + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/test/List.test.ets b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..4cb91737cdc9ce6f192468ebc1058d2c0b4597bf --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/test/List.test.ets @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import timepicker from './TimePicker' + +export default function testsuite() { + timepicker() + +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/test/TimePicker.ets b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/test/TimePicker.ets new file mode 100644 index 0000000000000000000000000000000000000000..2d48aa44c7772b5e340efd1ce2465c74979610d8 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/test/TimePicker.ets @@ -0,0 +1,858 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// @ts-nocheck +import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' +import events_emitter from '@ohos.events.emitter'; +import Utils from './Utils.ets'; +export default function timepicker() { + describe('ActsAceTimePickerTest', function () { + beforeEach(async function (done) { + await Utils.sleep(2000); + console.info("timepicker beforeEach start"); + done(); + }) + + afterEach(async function (done) { + console.info("timepicker afterEach start"); + + try { + var eventData = { + data: { + "disappearTextStyle": {color:Color.Black,font:{size:8,weight:FontWeight.Lighter}}, + "textStyle": {color:Color.Red,font:{size:'10px',weight:FontWeight.Normal}}, + "selectedTextStyle": {color:Color.Blue,font:{size:'20px',weight:FontWeight.Bold}} + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[timepicker_afterEach] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[selectTest_afterEach] change component data error: " + err.message); + } + done(); + }) + + /* + * @tc.number ArkUI_Stage_timepicker_disappearTextStyle_0001 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc get the default value + */ + it('ArkUI_Stage_timepicker_disappearTextStyle_0001', 0, async function (done) { + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_disappearTextStyle_0001] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF000000'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('8.00fp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Lighter'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_disappearTextStyle_0002 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_disappearTextStyle_0002', 0, async function (done) { + let value = {color:Color.Black,font:{size:8,weight:FontWeight.Bolder}} + try { + var eventData = { + data: { + "disappearTextStyle":JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_disappearTextStyle_0002] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_disappearTextStyle_0002] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.error("[ArkUI_Stage_timepicker_disappearTextStyle_0002] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF000000'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('8.00fp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Bolder'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_disappearTextStyle_0003 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_disappearTextStyle_0003', 0, async function (done) { + let value = {color:0x808080,font:{size:8,weight:100}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_disappearTextStyle_0003] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_disappearTextStyle_0003] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timePicker_disappearTextStyle_0003] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF808080'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('8.00fp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('100'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_disappearTextStyle_0004 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_disappearTextStyle_0004', 0, async function (done) { + let value = {color:'#ff0000',font:{size:'1px',weight:'700'}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_disappearTextStyle_0004] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_disappearTextStyle_0004] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_disappearTextStyle_0004] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FFFF0000'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('1.00px'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('700'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_disappearTextStyle_0005 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_disappearTextStyle_0005', 0, async function (done) { + let value = {color:Color.Green,font:{size:30,weight:450}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_disappearTextStyle_0005] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_disappearTextStyle_0005] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_disappearTextStyle_0005] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF008000'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('30.00fp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_disappearTextStyle_0006 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_disappearTextStyle_0006', 0, async function (done) { + let value = {color:'#80808g',font:{size:-1,weight:1000}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_disappearTextStyle_0006] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_disappearTextStyle_0006] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_disappearTextStyle_0006] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF182431'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('14.00vp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_disappearTextStyle_0007 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_disappearTextStyle_0007', 0, async function (done) { + let value = {color:'xxx',font:{size:'xxx',weight:FontWeight.Bold}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_disappearTextStyle_0007] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_disappearTextStyle_0007] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_disappearTextStyle_0007] disappearColor:" + obj.$attrs.disappearTextStyle.color); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF182431'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('14.00vp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Bold'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_disappearTextStyle_0008 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_disappearTextStyle_0008', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'20vp',weight:900}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_disappearTextStyle_0008] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_disappearTextStyle_0008] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('20.00vp'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('900'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_disappearTextStyle_0009 + * @tc.name Tests the disappearTextStyle property of the picker component + * @tc.desc set disappearTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_disappearTextStyle_0009', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'15lpx',weight:90}} + try { + var eventData = { + data: { + "disappearTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_disappearTextStyle_0009] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_disappearTextStyle_0009] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.disappearTextStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.disappearTextStyle.font.size).assertEqual('15.00lpx'); + expect(obj.$attrs.disappearTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_textStyle_0001 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc get the default value + */ + it('ArkUI_Stage_timepicker_textStyle_0001', 0, async function (done) { + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_textStyle_0001] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FFFF0000'); + expect(obj.$attrs.textStyle.font.size).assertEqual('10.00px'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_textStyle_0002 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_timepicker_textStyle_0002', 0, async function (done) { + let value = {color:Color.Red,font:{size:'10px',weight:FontWeight.Bolder}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_textStyle_0002] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_textStyle_0002] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.error("[ArkUI_Stage_timepicker_textStyle_0002] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FFFF0000'); + expect(obj.$attrs.textStyle.font.size).assertEqual('10.00px'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Bolder'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_textStyle_0003 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_timepicker_textStyle_0003', 0, async function (done) { + let value = {color:0xFF808080,font:{size:'10px',weight:100}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_textStyle_0003] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_textStyle_0003] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_textStyle_0003] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FF808080'); + expect(obj.$attrs.textStyle.font.size).assertEqual('10.00px'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('100'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_textStyle_0004 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_timepicker_textStyle_0004', 0, async function (done) { + let value = {color:'#00ff00',font:{size:'1px',weight:'700'}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_textStyle_0004] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_textStyle_0004] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_textStyle_0004] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FF00FF00'); + expect(obj.$attrs.textStyle.font.size).assertEqual('1.00px'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('700'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_textStyle_0005 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_timepicker_textStyle_0005', 0, async function (done) { + let value = {color:Color.Green,font:{size:30,weight:450}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_textStyle_0005] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_textStyle_0005] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_textStyle_0005] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FF008000'); + expect(obj.$attrs.textStyle.font.size).assertEqual('30.00fp'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_textStyle_0006 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_timepicker_textStyle_0006', 0, async function (done) { + let value = {color:'#80808g',font:{size:-1,weight:1000}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_textStyle_0006] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_textStyle_0006] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_textStyle_0006] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FF182431'); + expect(obj.$attrs.textStyle.font.size).assertEqual('16.00vp'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_textStyle_0007 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_timepicker_textStyle_0007', 0, async function (done) { + let value = {color:'xxx',font:{size:'xxx',weight:FontWeight.Lighter}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_textStyle_0007] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_textStyle_0007] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_textStyle_0007] disappearColor:" + obj.$attrs.textStyle.color); + expect(obj.$attrs.textStyle.color).assertEqual('#FF182431'); + expect(obj.$attrs.textStyle.font.size).assertEqual('16.00vp'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Lighter'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_textStyle_0008 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_timepicker_textStyle_0008', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'20vp',weight:900}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_textStyle_0008] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_textStyle_0008] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.textStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.textStyle.font.size).assertEqual('20.00vp'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('900'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_textStyle_0009 + * @tc.name Tests the textStyle property of the picker component + * @tc.desc set textStyle then get the value + */ + it('ArkUI_Stage_timepicker_textStyle_0009', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'15lpx',weight:90}} + try { + var eventData = { + data: { + "textStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_textStyle_0009] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_textStyle_0009] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.textStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.textStyle.font.size).assertEqual('15.00lpx'); + expect(obj.$attrs.textStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_selectedTextStyle_0001 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc get the default value + */ + it('ArkUI_Stage_timepicker_selectedTextStyle_0001', 0, async function (done) { + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0001] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF0000FF'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00px'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Bold'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_selectedTextStyle_0002 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_selectedTextStyle_0002', 0, async function (done) { + let value = {color:Color.Blue,font:{size:'20px',weight:FontWeight.Bolder}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0002] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_selectedTextStyle_0002] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.error("[ArkUI_Stage_timepicker_selectedTextStyle_0002] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF0000FF'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00px'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Bolder'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_selectedTextStyle_0003 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_selectedTextStyle_0003', 0, async function (done) { + let value = {color:0xFF808080,font:{size:'20px',weight:100}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0003] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_selectedTextStyle_0003] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0003] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF808080'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00px'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('100'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_selectedTextStyle_0004 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_selectedTextStyle_0004', 0, async function (done) { + let value = {color:'#00ff00',font:{size:'1px',weight:'700'}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0004] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_selectedTextStyle_0004] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0004] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF00FF00'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('1.00px'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('700'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_selectedTextStyle_0005 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_selectedTextStyle_0005', 0, async function (done) { + let value = {color:Color.Green,font:{size:30,weight:450}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0005] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_selectedTextStyle_0005] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0005] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF008000'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('30.00fp'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_selectedTextStyle_0006 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_selectedTextStyle_0006', 0, async function (done) { + let value = {color:'#80808g',font:{size:-1,weight:1000}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0006] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_selectedTextStyle_0006] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0006] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF007DFF'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00vp'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_selectedTextStyle_0007 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_selectedTextStyle_0007', 0, async function (done) { + let value = {color:'xxx',font:{size:'xxx',weight:FontWeight.Lighter}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0007] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_selectedTextStyle_0007] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0007] disappearColor:" + obj.$attrs.selectedTextStyle.color); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF007DFF'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00vp'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Lighter'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_selectedTextStyle_0008 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_selectedTextStyle_0008', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'20vp',weight:900}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0008] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_selectedTextStyle_0008] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('20.00vp'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('900'); + done(); + }); + + /* + * @tc.number ArkUI_Stage_timepicker_selectedTextStyle_0009 + * @tc.name Tests the selectedTextStyle property of the picker component + * @tc.desc set selectedTextStyle then get the value + */ + it('ArkUI_Stage_timepicker_selectedTextStyle_0009', 0, async function (done) { + let value = {color:'rgb(138,43,226)',font:{size:'15lpx',weight:90}} + try { + var eventData = { + data: { + "selectedTextStyle": JSON.stringify(value) + } + } + var innerEvent = { + eventId: 184, + priority: events_emitter.EventPriority.LOW + } + console.info("[ArkUI_Stage_timepicker_selectedTextStyle_0009] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[ArkUI_Stage_timepicker_selectedTextStyle_0009] change component data error: " + err.message); + } + await Utils.sleep(3000); + let strJson = getInspectorByKey('timePicker'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF8A2BE2'); + expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('15.00lpx'); + expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Normal'); + done(); + }); + }) + } + diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/test/Utils.ets b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/test/Utils.ets new file mode 100644 index 0000000000000000000000000000000000000000..6fecbfe80e6e5a3882dac77004efbc26a7faefea --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/test/Utils.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default class Utils { + static sleep(time){ + return new Promise((resolve,reject)=>{ + setTimeout(()=>{ + resolve("ok") + },time) + }).then(()=>{ + console.info(`sleep ${time} over...`) + }) + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/module.json b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..2b03fde2a1898cf911b3b3f2f94a553bca8ebb86 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/module.json @@ -0,0 +1,41 @@ +{ + "module": { + "name": "phone", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "visible": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/element/color.json b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/element/string.json b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..65d8fa5a7cf54aa3943dcd0214f58d1771bc1f6c --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/1.png b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/1.png new file mode 100644 index 0000000000000000000000000000000000000000..7d1ac17391353808e50457c0e63fd5168d5b583e Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/1.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/2.png b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/2.png new file mode 100644 index 0000000000000000000000000000000000000000..76e26ebcb1eed4b5b510fdf7335ad0f983c9bd93 Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/2.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/3.png b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/3.png new file mode 100644 index 0000000000000000000000000000000000000000..bdfe81b90c00f732f529a3423b6d47f66bc3d282 Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/3.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/4.png b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/4.png new file mode 100644 index 0000000000000000000000000000000000000000..f91e165b5f5194b7f9658b3e54d6e357cdc24aa3 Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/4.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/5.png b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/5.png new file mode 100644 index 0000000000000000000000000000000000000000..b1a25b321be240ebd613eeac9677702f3fcac3b5 Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/5.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/icon.png b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/media/icon.png differ diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/profile/test_pages.json b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/profile/test_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..77e90731b5a38d861663029b483df3d3ac9ec74b --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "TestAbility/pages/Index" + ] +} diff --git a/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets b/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets index 04fd38121df8a3ebeae8d5de914f04e39ee4007d..8a3b35926fcbd8e30a1f3fa1ea9c5f944dfdb510 100644 --- a/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets +++ b/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets @@ -611,8 +611,10 @@ struct Index { this.enterPageEnd=false }else if(this.isProgressFinish){ console.info("isProgressFinish==>") - Utils.emitEvent(this.progress,114) - this.isProgressFinish=false + if(this.progress="100"){ + Utils.emitEvent(this.progress,114) + this.isProgressFinish=false + } } }) .onConsole((event) => { diff --git a/arkui/ace_napi_test/entry/src/main/cpp/napi/napi_test.cpp b/arkui/ace_napi_test/entry/src/main/cpp/napi/napi_test.cpp index e23b298e2fa39d23cb1f723883294664eb93523f..20740aaf96a0b8e1ca95ba1e8e1c9ea39d8b63fe 100644 --- a/arkui/ace_napi_test/entry/src/main/cpp/napi/napi_test.cpp +++ b/arkui/ace_napi_test/entry/src/main/cpp/napi/napi_test.cpp @@ -1862,9 +1862,6 @@ static void AddPromiseCompleteCB(napi_env env, napi_status status, void *data) { } else { NAPI_CALL_RETURN_VOID(env, napi_reject_deferred(env, addonData->deferred, result)); } - if (addonData->callback != nullptr) { - NAPI_CALL_RETURN_VOID(env, napi_delete_reference(env, addonData->callback)); - } NAPI_CALL_RETURN_VOID(env, napi_delete_async_work(env, addonData->asyncWork)); free(addonData); diff --git a/arkui/ace_napi_test/entry/src/main/ets/test/NativeApiStringTest.ets b/arkui/ace_napi_test/entry/src/main/ets/test/NativeApiStringTest.ets index 6656f1636d51a7e7d9fddbf6dc810900e560a8b5..6e462b33a8bc80e9c57327b2bbea97413aef3e45 100644 --- a/arkui/ace_napi_test/entry/src/main/ets/test/NativeApiStringTest.ets +++ b/arkui/ace_napi_test/entry/src/main/ets/test/NativeApiStringTest.ets @@ -1115,17 +1115,26 @@ export default function nativeApiStringJsunit() { console.info('aceNapiTest079 START'); value = napitest.testPromise(1).then( (result)=>{ - console.info('aceNapiTest079 testString result is: ' + result + "--" + JSON.stringify(result)); - expect(result > 0).assertTrue(); + console.info('aceNapiTest079 testString resolve1 result is: ' + result + "--" + JSON.stringify(result)); + expect(result > 0).assertTrue(); + done(); + }, (result) =>{ + console.info('aceNapiTest079 testString reject1 result is: ' + result + "--" + JSON.stringify(result)); + expect(result < 0).assertTrue(); + done(); } ); value = napitest.testPromise(-1).then( - (result)=>{ - console.info('aceNapiTest079 testString result is: ' + result + "--" + JSON.stringify(result)); - expect(result > 0).assertTrue(); - } + (result)=>{ + console.info('aceNapiTest079 testString resolve2 result is: ' + result + "--" + JSON.stringify(result)); + expect(result > 0).assertTrue(); + done(); + }, (result) =>{ + console.info('aceNapiTest079 testString reject2 result is: ' + result + "--" + JSON.stringify(result)); + expect(result < 0).assertTrue(); + done(); + } ); - done(); }); /** diff --git a/bundlemanager/bundle_standard/bundlemanager/BUILD.gn b/bundlemanager/bundle_standard/bundlemanager/BUILD.gn index 4e2522cf95cf6c95fea892ad87937842e8fd0025..634514207ffb69e7c5d04229cc9da979c7c4cdd9 100644 --- a/bundlemanager/bundle_standard/bundlemanager/BUILD.gn +++ b/bundlemanager/bundle_standard/bundlemanager/BUILD.gn @@ -26,6 +26,7 @@ group("bundlemanager") { "actsbmsjsunpermissiontest:ActsBmsJsUnPermissionTest", "actsbmsmetadatatest:ActsBmsMetaDataTest", "actsbundlemanageretstest:ActsBundleManagerEtsTest", + "actsbundlemanageroverlaytest:ActsBundleMgrOverlayEtsTest", "actsbundlemanagerstagetest:ActsBundleMgrStageEtsTest", "actsbundlemanagertest:ActsBundleManagerTest", "actsbundlenativetest:ActsBundleNativeTest", @@ -52,6 +53,7 @@ group("bundlemanager") { "sceneProject/bmsmainabilitysecondscene:bmsMainAbilitySecondScene", "sceneProject/bmsmodulenameone:bmsModuleNameTest1", "sceneProject/bmsmodulenametwo:bmsModuleNameTest2", + "sceneProject/bmsoverlaydemo:bmsOverlayDemo", "sceneProject/bmsscenefive:bmsJstest5", "sceneProject/bmsscenefour:bmsJstest4", "sceneProject/bmssceneone:bmsJstest1", diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/AppScope/app.json b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..47c9f3c90c57d929853ed842805ea0c5f704a440 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app":{ + "bundleName":"ohos.acts.bundle.overlay.test", + "vendor":"huawei", + "versionCode":1000000, + "versionName":"1.0.0", + "debug":false, + "icon":"$media:icon", + "label":"$string:app_name", + "description":"$string:description_application", + "distributedNotificationEnabled":true, + "keepAlive":true, + "singleUser":true, + "minAPIVersion":9, + "targetAPIVersion":9, + "car":{ + "apiCompatibleVersion":9, + "singleUser":false + } + } +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/AppScope/resources/base/element/string.json b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..ee69f9a861d9dc269ed6638735d52674583498e1 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"ohosProject" + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/BUILD.gn b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/BUILD.gn old mode 100755 new mode 100644 similarity index 68% rename from ability/ability_runtime/non_concurrent/actsthirdapponerelytest/BUILD.gn rename to bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/BUILD.gn index f5225073acef5a5533cde9373fd1b68c94b60c04..8f3b7612dcdff57b62dccc01c0c774c2c4479c60 --- a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/BUILD.gn +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/BUILD.gn @@ -13,30 +13,30 @@ import("//test/xts/tools/build/suite.gni") -ohos_hap_assist_suite("ActsThirdAppOneRelyHap") { +ohos_js_hap_suite("ActsBundleMgrOverlayEtsTest") { hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - hap_name = "ActsThirdAppOneRelyHap" - testonly = true deps = [ - ":actsthirdapponerelytest_js_assets", - ":actsthirdapponerelytest_resources", + ":actbmsoverlayetstest_js_assets", + ":actbmsoverlayetstest_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsBundleMgrOverlayEtsTest" + subsystem_name = "bundlemanager" + part_name = "bundle_framework" } -ohos_app_scope("actsthirdapponerelytest_app_profile") { +ohos_app_scope("actbmsoverlayetstest_app_profile") { app_profile = "AppScope/app.json" sources = [ "AppScope/resources" ] } -ohos_js_assets("actsthirdapponerelytest_js_assets") { +ohos_js_assets("actbmsoverlayetstest_js_assets") { source_dir = "entry/src/main/ets" } -ohos_resources("actsthirdapponerelytest_resources") { +ohos_resources("actbmsoverlayetstest_resources") { sources = [ "entry/src/main/resources" ] - deps = [ ":actsthirdapponerelytest_app_profile" ] + deps = [ ":actbmsoverlayetstest_app_profile" ] hap_profile = "entry/src/main/module.json" } diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/Test.json b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..a527a0dacba47698b878b3d19c78e664c43765f2 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/Test.json @@ -0,0 +1,42 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "180000", + "bundle-name": "ohos.acts.bundle.overlay.test", + "module-name": "testModule", + "shell-timeout": "600000", + "testcase-timeout": 70000 + }, + "kits": [ + { + "test-file-name": [ + "ActsBundleMgrOverlayEtsTest.hap", + "bmsOverlayDemo.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command":[ + "remount", + "mkdir /data/test/" + ] + }, + { + "type": "PushKit", + "push": [ + "bmsOverlayDemo.hap -> /data/test/bmsOverlayDemo.hap" + ] + }, + { + "type": "ShellKit", + "teardown-command":[ + "bm uninstall -n ohos.acts.bundle.overlay.test", + "rm -rf /data/test/" + ] + } + ] +} + diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/Application/AbilityStage.ts b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 0000000000000000000000000000000000000000..cbcc939ff5d038c8e22947c2f0186d3407e691bc --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,9 @@ +import AbilityStage from "@ohos.app.ability.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("[Demo] MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/FormAbility/FormAbility.ts b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/FormAbility/FormAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..d443631109f5f73817ec907b36c1b7a3d353d357 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/FormAbility/FormAbility.ts @@ -0,0 +1,37 @@ +import FormExtension from '@ohos.app.form.FormExtensionAbility'; +import formBindingData from '@ohos.application.formBindingData'; +import formInfo from '@ohos.application.formInfo'; + +export default class FormAbility extends FormExtension { + onCreate(want) { + // Called to return a FormBindingData object. + let formData = {}; + return formBindingData.createFormBindingData(formData); + } + + onCastToNormal(formId) { + // Called when the form provider is notified that a temporary form is successfully + // converted to a normal form. + } + + onUpdate(formId) { + // Called to notify the form provider to update a specified form. + } + + onVisibilityChange(newStatus) { + // Called when the form provider receives form events from the system. + } + + onEvent(formId, message) { + // Called when a specified message event defined by the form provider is triggered. + } + + onDestroy(formId) { + // Called to notify the form provider that a specified form has been destroyed. + } + + onAcquireFormState(want) { + // Called to return a {@link FormState} object. + return formInfo.FormState.READY; + } +}; \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/MainAbility/MainAbility.ts b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..2fb66add2d57337f9e6a8d6367842b895b573afc --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,36 @@ +import Ability from '@ohos.app.ability.UIAbility' + +export default class MainAbility extends Ability { + onCreate(want,launchParam){ + // Ability is creating, initialize resources for this ability + console.log("[Demo] MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("[Demo] MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "MainAbility/pages/index/index", null) + } + + onWindowStageDestroy() { + //Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility onBackground") + } +}; \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/MainAbility/pages/index/index.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/MainAbility/pages/index/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..f172d89b07521c2a1991ab441e99479f72823209 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/MainAbility/pages/index/index.ets @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@ohos.router'; + +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' + + +@Entry +@Component +struct Index { + + aboutToAppear(){ + console.info("start run testcase!!!!") + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + console.info('start run testcase!!!') + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + build() { + Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World') + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(25) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/pages/second/second.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/MainAbility/pages/second/second.ets old mode 100755 new mode 100644 similarity index 91% rename from ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/pages/second/second.ets rename to bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/MainAbility/pages/second/second.ets index 33d9ae45245db03fd252ef7c1a85c9e284028e0d..f9009a3e8567d1f4557ebc11dded54c7e27c0b0d --- a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/pages/second/second.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/MainAbility/pages/second/second.ets @@ -20,7 +20,7 @@ struct Second { private content: string = "Second Page" build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Text(`${this.content}`) .fontSize(50) .fontWeight(FontWeight.Bold) diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/ServiceAbility/FormAbility.ts b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/ServiceAbility/FormAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..d443631109f5f73817ec907b36c1b7a3d353d357 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/ServiceAbility/FormAbility.ts @@ -0,0 +1,37 @@ +import FormExtension from '@ohos.app.form.FormExtensionAbility'; +import formBindingData from '@ohos.application.formBindingData'; +import formInfo from '@ohos.application.formInfo'; + +export default class FormAbility extends FormExtension { + onCreate(want) { + // Called to return a FormBindingData object. + let formData = {}; + return formBindingData.createFormBindingData(formData); + } + + onCastToNormal(formId) { + // Called when the form provider is notified that a temporary form is successfully + // converted to a normal form. + } + + onUpdate(formId) { + // Called to notify the form provider to update a specified form. + } + + onVisibilityChange(newStatus) { + // Called when the form provider receives form events from the system. + } + + onEvent(formId, message) { + // Called when a specified message event defined by the form provider is triggered. + } + + onDestroy(formId) { + // Called to notify the form provider that a specified form has been destroyed. + } + + onAcquireFormState(want) { + // Called to return a {@link FormState} object. + return formInfo.FormState.READY; + } +}; \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/TestAbility/TestAbility.ts b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/TestAbility/TestAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..3e2d601de1553cc7d790ee83b23414b26a47913b --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/TestAbility/TestAbility.ts @@ -0,0 +1,30 @@ +import Ability from '@ohos.app.ability.UIAbility' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + console.log('TestAbility onCreate') + } + + onDestroy() { + console.log('TestAbility onDestroy') + } + + onWindowStageCreate(windowStage) { + console.log('TestAbility onWindowStageCreate') + windowStage.setUIContent(this.context, 'TestAbility/pages/index', null) + + globalThis.abilityContext = this.context; + } + + onWindowStageDestroy() { + console.log('TestAbility onWindowStageDestroy') + } + + onForeground() { + console.log('TestAbility onForeground') + } + + onBackground() { + console.log('TestAbility onBackground') + } +}; \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/TestAbility/pages/index.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/TestAbility/pages/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..b93567f962921124b282f78c8ef123965d1460c9 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/TestAbility/pages/index.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@ohos.router'; + +@Entry +@Component +struct Index { + aboutToAppear() { + console.info('TestAbility index aboutToAppear') + } + @State message: string = 'Hello World' + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .width('35%') + .height('5%') + .onClick(()=>{ + }) + } + .width('100%') + } + .height('100%') + } + } \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts old mode 100755 new mode 100644 similarity index 73% rename from ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts rename to bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index 303a1dd007800ea611d2cf41ee3bf7a2bad5d59a..258481fbf031910495016da7ed433d2fb5b01a7e --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import TestRunner from '@ohos.application.testRunner' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' @@ -53,13 +38,13 @@ export default class OpenHarmonyTestRunner implements TestRunner { console.log('OpenHarmonyTestRunner onRun run') abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + var cmd = 'aa start -d 0 -a ohos.acts.bundle.overlay.test.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) console.info('cmd : '+cmd) abilityDelegator.executeShellCommand(cmd, diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/GetOverlayModuleInfo.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/GetOverlayModuleInfo.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..1cde2d2e5582e9ad9d59a7821c1e07c88c9a0ff7 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/GetOverlayModuleInfo.test.ets @@ -0,0 +1,140 @@ +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impligetProfileByAbilityEmptyAbilityCalled. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import overlay from '@ohos.bundle.overlay'; +import Utils from "./Utils"; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" + +const MODULE_NAME = "testModule"; +const MODULE_NAME1 = "test1"; +const MODULE_NAME2 = "stage1"; +const ERROR_INCOMING_MODULE_NAME_NOT_INSTALL = 17700002; +const ERROR_INCOMING_MODULE_NAME_NOT_OVERLAY = 17700033; +const ERROR_CODE = 401; + +export default function getOverlayModuleInfo() { + describe('getOverlayModuleInfo', function () { + /* + * @tc.number: SUB_BMS_APPINFO_OVERLAY_0001 + * @tc.name: GetOverlayModuleInfoModuleNameIsNull + * @tc.desc: The query fails when the incoming moduleName is empty + */ + it('GetOverlayModuleInfoModuleNameIsNull', 0, async function (done) { + try { + await overlay.getOverlayModuleInfo("").then(data => { + Utils.info("GetOverlayModuleInfoModuleNameIsNull result" + JSON.stringify(data)); + expect().assertFail(); + }).catch(err => { + Utils.info("GetOverlayModuleInfoModuleNameIsNull fail" + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_CODE); + }); + } catch (e) { + Utils.info("GetOverlayModuleInfoModuleNameIsNull catch" + JSON.stringify(e)); + expect(e.code).assertEqual(ERROR_CODE); + } + + try { + overlay.getOverlayModuleInfo("", (err,data) => { + Utils.info("GetOverlayModuleInfoModuleNameIsNull result" + JSON.stringify(data)); + Utils.info("GetOverlayModuleInfoModuleNameIsNull fail" + JSON.stringify(err)); + expect().assertFail(); + done(); + }); + } catch (e) { + Utils.info("GetOverlayModuleInfoModuleNameIsNull callback catch" + JSON.stringify(e)); + expect(e.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /* + * @tc.number: SUB_BMS_APPINFO_OVERLAY_0003 + * @tc.name: GetOverlayModuleInfoModuleNameNotInstall + * @tc.desc: The query fails when the incoming moduleName is not installed + */ + it('GetOverlayModuleInfoModuleNameNotInstall', 0, async function (done) { + await overlay.getOverlayModuleInfo(MODULE_NAME1).then(data => { + Utils.info("GetOverlayModuleInfoModuleNameNotInstall result" + JSON.stringify(data)); + expect().assertFail(); + }).catch(err => { + Utils.info("GetOverlayModuleInfoModuleNameNotInstall fail" + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_INSTALL); + }); + + overlay.getOverlayModuleInfo(MODULE_NAME1, (err,data) => { + Utils.info("GetOverlayModuleInfoModuleNameNotInstall result" + JSON.stringify(data)); + Utils.info("GetOverlayModuleInfoModuleNameNotInstall fail" + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_INSTALL); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_OVERLAY_0004 + * @tc.name: GetOverlayModuleInfoModuleNameNotOverlay + * @tc.desc: Failed to set when the incoming moduleName is not overlay + */ + it('GetOverlayModuleInfoModuleNameNotOverlay', 0, async function (done) { + await overlay.getOverlayModuleInfo(MODULE_NAME).then(data => { + Utils.info("GetOverlayModuleInfoModuleNameNotOverlay result" + JSON.stringify(data)); + expect().assertFail(); + }).catch(err => { + Utils.info("GetOverlayModuleInfoModuleNameNotOverlay fail" + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_OVERLAY); + }); + + overlay.getOverlayModuleInfo(MODULE_NAME, (err,data) => { + Utils.info("GetOverlayModuleInfoModuleNameNotOverlay result" + JSON.stringify(data)); + Utils.info("GetOverlayModuleInfoModuleNameNotOverlay fail" + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_OVERLAY); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_OVERLAY_000X + * @tc.name: GetOverlayModuleInfoModuleNameIsOverlay + * @tc.desc: Query succeeded when the moduleName passed in is overlay + */ + it('GetOverlayModuleInfoModuleNameIsOverlay', 0, async function (done) { + await overlay.getOverlayModuleInfo(MODULE_NAME2).then(data => { + Utils.info("GetOverlayModuleInfoModuleNameIsOverlay result" + JSON.stringify(data)); + let overlayModuleInfoTest: overlay.OverlayModuleInfo = data; + expect(typeof (overlayModuleInfoTest.bundleName)).assertEqual('string'); + expect(data.bundleName).assertEqual("ohos.acts.bundle.overlay.test"); + expect(data.moduleName).assertEqual("stage1"); + expect(data.targetModuleName).assertEqual("entry1"); + expect(data.priority).assertEqual(1); + expect(data.state).assertEqual(2); + }).catch(err => { + Utils.info("GetOverlayModuleInfoModuleNameIsOverlay fail" + JSON.stringify(err)); + expect().assertFail() + }); + + overlay.getOverlayModuleInfo(MODULE_NAME2, (err,data) => { + // "bundleName":"ohos.acts.bundle.overlay.test","moduleName":"stage1","targetModuleName":"entry1","priority":1,"state":2 + Utils.info("GetOverlayModuleInfoModuleNameIsOverlay result" + JSON.stringify(data)); + Utils.info("GetOverlayModuleInfoModuleNameIsOverlay fail" + JSON.stringify(err)); + expect(data.bundleName).assertEqual("ohos.acts.bundle.overlay.test"); + expect(data.moduleName).assertEqual("stage1"); + expect(data.targetModuleName).assertEqual("entry1"); + expect(data.priority).assertEqual(1); + expect(data.state).assertEqual(2); + expect(err).assertNull(); + done(); + }); + }) + }) +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/GetTargetOverlayModuleInfos.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/GetTargetOverlayModuleInfos.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..cf421f81c56a75921e161e420b79162ede959d91 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/GetTargetOverlayModuleInfos.test.ets @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impligetProfileByAbilityEmptyAbilityCalled. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import overlay from '@ohos.bundle.overlay'; +import Utils from "./Utils"; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" + +const MODULE_NAME = "testModule"; +const MODULE_NAME1 = "test1"; +const MODULE_NAME2 = "stage1"; +const ERROR_INCOMING_MODULE_NAME_NOT_INSTALL = 17700002; +const ERROR_INCOMING_MODULE_NAME_IS_OVERLAY = 17700034; +const ERROR_CODE = 401; + +export default function getTargetOverlayModuleInfos() { + describe('getTargetOverlayModuleInfos', function () { + /* + * @tc.number: SUB_BMS_APPINFO_OVERLAY_0006 + * @tc.name: GetTargetOverlayModuleInfosModuleNameIsNull + * @tc.desc: The query fails when the incoming moduleName is empty + */ + it('GetTargetOverlayModuleInfosModuleNameIsNull', 0, async function (done) { + try { + await overlay.getTargetOverlayModuleInfos("").then(data => { + Utils.info("GetTargetOverlayModuleInfosModuleNameIsNull result" + JSON.stringify(data)); + expect().assertFail(); + }).catch(err => { + Utils.info("GetTargetOverlayModuleInfosModuleNameIsNull fail" + JSON.stringify(err)); + expect().assertFail(); + }); + } catch (e) { + Utils.info("GetTargetOverlayModuleInfosModuleNameIsNull catch" + JSON.stringify(e)); + expect(e.code).assertEqual(ERROR_CODE); + } + + try { + overlay.getTargetOverlayModuleInfos("", (err,data) => { + Utils.info("GetTargetOverlayModuleInfosModuleNameIsNull result" + JSON.stringify(data)); + Utils.info("GetTargetOverlayModuleInfosModuleNameIsNull fail" + JSON.stringify(err)); + expect().assertFail(); + done(); + }); + } catch (e) { + Utils.info("SetOverlayEnabledModuleNameIsNull callback catch" + JSON.stringify(e)); + expect(e.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /* + * @tc.number: SUB_BMS_APPINFO_OVERLAY_0008 + * @tc.name: GetTargetOverlayModuleInfosModuleNameNotInstall + * @tc.desc: The query fails when the incoming moduleName is not installed + */ + it('GetTargetOverlayModuleInfosModuleNameNotInstall', 0, async function (done) { + await overlay.getTargetOverlayModuleInfos(MODULE_NAME1).then(data => { + Utils.info("GetTargetOverlayModuleInfosModuleNameNotInstall result" + JSON.stringify(data)); + expect().assertFail(); + }).catch(err => { + Utils.info("GetTargetOverlayModuleInfosModuleNameNotInstall fail" + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_INSTALL); + }); + + overlay.getTargetOverlayModuleInfos(MODULE_NAME1, (err,data) => { + Utils.info("GetTargetOverlayModuleInfosModuleNameNotInstall result" + JSON.stringify(data)); + Utils.info("GetTargetOverlayModuleInfosModuleNameNotInstall fail" + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_INSTALL); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_OVERLAY_0009 + * @tc.name: GetTargetOverlayModuleInfosModuleNameIsOverlay + * @tc.desc: Failed to set when the incoming moduleName is overlay + */ + it('GetTargetOverlayModuleInfosModuleNameIsOverlay', 0, async function (done) { + await overlay.getTargetOverlayModuleInfos(MODULE_NAME2).then(data => { + Utils.info("GetTargetOverlayModuleInfosModuleNameIsOverlay result" + JSON.stringify(data)); + expect().assertFail(); + }).catch(err => { + Utils.info("GetTargetOverlayModuleInfosModuleNameIsOverlay fail" + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_IS_OVERLAY); + }); + + overlay.getTargetOverlayModuleInfos(MODULE_NAME2, (err,data) => { + Utils.info("GetTargetOverlayModuleInfosModuleNameIsOverlay result" + JSON.stringify(data)); + Utils.info("GetTargetOverlayModuleInfosModuleNameIsOverlay fail" + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_IS_OVERLAY); + done(); + }); + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/pages/index/index2.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/List.test.ets old mode 100755 new mode 100644 similarity index 64% rename from ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/pages/index/index2.ets rename to bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/List.test.ets index 4827dd0d3d7a5301526dad69ddf7a2037f087f69..2803b3d08f99a359be31591bfe4dfc479d21051c --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/pages/index/index2.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/List.test.ets @@ -12,16 +12,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@Entry -@Component -struct Index2 { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('页面2') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } + +import SetOverlayEnabled from './SetOverlayEnabled.test.ets'; +import GetOverlayModuleInfo from './GetOverlayModuleInfo.test.ets'; +import GetTargetOverlayModuleInfos from './GetTargetOverlayModuleInfos.test.ets'; + +export default function testsuite() { + SetOverlayEnabled(); + GetOverlayModuleInfo(); + GetTargetOverlayModuleInfos(); } \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/SetOverlayEnabled.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/SetOverlayEnabled.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..69a21441d6ca173e9e5bbb33fcf2a3bbc517bf12 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/SetOverlayEnabled.test.ets @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impligetProfileByAbilityEmptyAbilityCalled. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import overlay from '@ohos.bundle.overlay'; +import Utils from "./Utils"; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" + +const MODULE_NAME = "testModule"; +const MODULE_NAME1 = "test1"; +const ERROR_INCOMING_MODULE_NAME_NOT_INSTALL = 17700002; +const ERROR_INCOMING_MODULE_NAME_NOT_OVERLAY = 17700033; +const ERROR_CODE = 401; + +export default function setOverlayEnabled() { + describe('setOverlayEnabled', function () { + /* + * @tc.number: SUB_BMS_OVERLAY_ENABLED_0001 + * @tc.name: SetOverlayEnabledModuleNameIsNull + * @tc.desc: Failed to set when the incoming moduleName is empty + */ + it('SetOverlayEnabledModuleNameIsNull', 0, async function (done) { + try { + await overlay.setOverlayEnabled("", true).then(data => { + console.info("SetOverlayEnabledModuleNameIsNull result1111" + JSON.stringify(data)) + Utils.info("SetOverlayEnabledModuleNameIsNull result" + JSON.stringify(data)); + expect().assertFail(); + }).catch(err => { + Utils.info("SetOverlayEnabledModuleNameIsNull fail" + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_CODE); + }); + } catch (e) { + Utils.info("SetOverlayEnabledModuleNameIsNull catch" + JSON.stringify(e)); + expect(e.code).assertEqual(ERROR_CODE); + } + + try { + overlay.setOverlayEnabled("", true, (err,data) => { + Utils.info("SetOverlayEnabledModuleNameIsNull result" + JSON.stringify(data)); + Utils.info("SetOverlayEnabledModuleNameIsNull fail" + JSON.stringify(err)); + expect().assertFail(); + done(); + }); + } catch (e) { + Utils.info("SetOverlayEnabledModuleNameIsNull callback catch" + JSON.stringify(e)); + expect(e.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /* + * @tc.number: SUB_BMS_OVERLAY_ENABLED_0005 + * @tc.name: SetOverlayEnabledModuleNameNotInstall + * @tc.desc: Failed to set when the incoming moduleName is not installed + */ + it('SetOverlayEnabledModuleNameNotInstall', 0, async function (done) { + await overlay.setOverlayEnabled(MODULE_NAME1, true).then(data => { + Utils.info("SetOverlayEnabledModuleNameNotInstall result" + JSON.stringify(data)); + expect().assertFail(); + }).catch(err => { + Utils.info("SetOverlayEnabledModuleNameNotInstall fail" + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_INSTALL); + }); + + overlay.setOverlayEnabled(MODULE_NAME1, true, (err,data) => { + Utils.info("SetOverlayEnabledModuleNameNotInstall result" + JSON.stringify(data)); + Utils.info("SetOverlayEnabledModuleNameNotInstall fail" + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_INSTALL); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_OVERLAY_ENABLED_0006 + * @tc.name: SetOverlayEnabledModuleNameIsNotOverlay + * @tc.desc: Failed to set when the incoming moduleName is not overlay + */ + it('SetOverlayEnabledModuleNameIsNotOverlay', 0, async function (done) { + await overlay.setOverlayEnabled(MODULE_NAME, true).then(data => { + Utils.info("SetOverlayEnabledModuleNameIsNotOverlay result" + JSON.stringify(data)); + expect().assertFail(); + }).catch(err => { + Utils.info("SetOverlayEnabledModuleNameIsNotOverlay fail" + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_OVERLAY); + }); + + overlay.setOverlayEnabled(MODULE_NAME, true, (err,data) => { + Utils.info("SetOverlayEnabledModuleNameIsNotOverlay result" + JSON.stringify(data)); + Utils.info("SetOverlayEnabledModuleNameIsNotOverlay fail" + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_OVERLAY); + done(); + }); + }) + }) +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/Utils.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/Utils.ets new file mode 100644 index 0000000000000000000000000000000000000000..7609914ba8e464d002f847ee3f7d3cc0f339250d --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/Utils.ets @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import hiLog from '@ohos.hilog'; + +export default class Utils { + + static info(str) { + hiLog.info(0 , "BMSTEST" , str); + } + + static sleep(time) { + return new Promise((resolve, reject) => { + setTimeout((data) => { + resolve(data) + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } +} + + + + diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/module.json b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..8fa31f274747ef1c9f6cf39dad893ed7346ce908 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/module.json @@ -0,0 +1,379 @@ +{ + "module": { + "name": "testModule", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:testModule_entry_dsc", + "mainElement": "ohos.acts.bundle.overlay.test.MainAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "false" + } + ], + "abilities": [ + { + "name": "ohos.acts.bundle.overlay.test.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "singleton", + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities":[ + "entity.system.home" + ] + } + ], + "metadata": [ + { + "name": "ohos.ability.form", + "value": "", + "resource": "$profile:shortcuts_config" + }, + { + "name": "ohos.ability.form1", + "value": "", + "resource": "$profile:form_config" + }, + { + "name": "ohos.ability.form2", + "value": "", + "resource": "@profile:form_config" + }, + { + "name": "ohos.ability.form3", + "value": "", + "resource": "$profile:form_config1" + }, + { + "name": "ohos.ability.form4", + "value": "", + "resource": "$profile:invalid" + } + ] + }, + { + "name": "ohos.acts.bundle.overlay.test.MainAbility1", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "standard", + "orientation": "landscape", + "skills": [] + }, + { + "name": "ohos.acts.bundle.overlay.test.MainAbility2", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "landscape_inverted", + "skills": [] + }, + { + "name": "ohos.acts.bundle.overlay.test.MainAbility3", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "portrait_inverted", + "skills": [] + }, + { + "name": "ohos.acts.bundle.overlay.test.MainAbility4", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "auto_rotation", + "skills": [] + }, + { + "name": "ohos.acts.bundle.overlay.test.MainAbility5", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "auto_rotation_landscape", + "skills": [] + }, + { + "name": "ohos.acts.bundle.overlay.test.MainAbility6", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "auto_rotation_portrait", + "skills": [] + }, + { + "name": "ohos.acts.bundle.overlay.test.MainAbility7", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "auto_rotation_restricted", + "skills": [] + }, + { + "name": "ohos.acts.bundle.overlay.test.MainAbility8", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "auto_rotation_landscape_restricted", + "skills": [] + }, + { + "name": "ohos.acts.bundle.overlay.test.MainAbility9", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "auto_rotation_portrait_restricted", + "skills": [] + }, + { + "name": "ohos.acts.bundle.overlay.test.MainAbility10", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "locked", + "skills": [] + } + ], + "extensionAbilities": [ + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "metadata": [ + { + "name": "ohos.extension.form", + "value": "", + "resource": "$profile:shortcuts_config" + }, + { + "name": "ohos.extension.form1", + "value": "", + "resource": "$profile:form_config" + }, + { + "name": "ohos.extension.form2", + "value": "", + "resource": "@profile:form_config" + }, + { + "name": "ohos.extension.form3", + "value": "", + "resource": "$profile:form_config1" + }, + { + "name": "ohos.extension.form4", + "value": "", + "resource": "$profile:invalid" + } + ], + "name": "Form", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "form", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "Form1", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "form", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "workScheduler", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "workScheduler", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "inputMethod", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "inputMethod", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "accessibility", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "accessibility", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "fileShare", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "fileShare", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "staticSubscriber", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "staticSubscriber", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "wallpaper", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "wallpaper", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "backup", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "backup", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "window", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "window", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "enterpriseAdmin", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "enterpriseAdmin", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "thumbnail", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "thumbnail", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "preview", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "preview", + "visible": true + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.GET_BUNDLE_INFO", + "reason": "$string:permission_reason", + "usedScene": { + "abilities": ["MainAbility"], + "when": "always" + } + }, + { + "name": "ohos.permission.READ_CALENDAR", + "reason": "$string:permission_reason", + "usedScene": { + "abilities": ["MainAbility"], + "when": "inuse" + } + } + ], + "metadata": [ + { + "name": "MetaData1", + "value": "MetaDataValue", + "resource": "$profile:shortcuts_config" + } + ] + } +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/element/string.json b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..a4e9ba5b8d282aa4e86eb9389bf7c535226fd1c4 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,44 @@ +{ + "string": [ + { + "name": "testModule_entry_dsc", + "value": "i am an entry for testModule" + }, + { + "name": "testModule_entry_main", + "value": "the testModule entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + }, + { + "name": "form_FormAbility_desc", + "value": "form_description" + }, + { + "name": "form_FormAbility_label", + "value": "form_label" + }, + { + "name": "permission_reason", + "value": "Need permission" + } + ] +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/media/icon.png b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..474a55588fd7216113dd42073aadf254d4dba023 Binary files /dev/null and b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/media/icon.png differ diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/form_config.json b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/form_config.json new file mode 100644 index 0000000000000000000000000000000000000000..e892d44722d9e5b09ff78cb069ccc15d1fac872e --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/form_config.json @@ -0,0 +1,6 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" + ] +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/form_config1.txt b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/form_config1.txt new file mode 100644 index 0000000000000000000000000000000000000000..32f9ff7dc213b28017875b2e4679071350a74d1d --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/form_config1.txt @@ -0,0 +1 @@ +{"src": ["MainAbility/pages/index/index","MainAbility/pages/second/second"]} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/invalid.txt b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/invalid.txt new file mode 100644 index 0000000000000000000000000000000000000000..cdca51a17bcbc5128c3b424ef9467ecd68b98737 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/invalid.txt @@ -0,0 +1,5 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/main_pages.json b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..02221db61d317863114ff0ca4dd2b33586abff12 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" + ] +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/shortcuts_config.json b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/shortcuts_config.json new file mode 100644 index 0000000000000000000000000000000000000000..02221db61d317863114ff0ca4dd2b33586abff12 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/shortcuts_config.json @@ -0,0 +1,6 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" + ] +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/signature/openharmony_sx.p7b b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..8da769dd128eb963811a16a46f1168eb500cf789 Binary files /dev/null and b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/signature/openharmony_sx.p7b differ diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets index 63bb17078a76fc0cfdbc9b60ee6121437b35b4c3..958ad1e5752e29f1e96409c18e80c139b1525f20 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets @@ -94,6 +94,7 @@ export default function getBundleInfoForSelf() { await bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION).then(data => { console.info("getBundleInfoForSelfApplicationPro" + JSON.stringify(data.appInfo)); checkCommonBundleInfo(data); + expect(bundle.ExtensionAbilityType.PRINT).assertEqual(15); expect(data.appInfo.bundleType).assertEqual(bundle.BundleType.APP); expect(data.appInfo.name).assertEqual(BUNDLE_NAME); expect(data.appInfo.description).assertEqual("$string:description_application"); diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/List.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/List.test.ets index 684f45db07b845a6e7fcf5835533eb5c33b47e1c..e94ffbcc20b186c587158dc0281f9f9bfb091365 100755 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/List.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/List.test.ets @@ -19,6 +19,7 @@ import getBundleInfoForSelf from './GetBundleInfoForSelf.test.ets'; import getSecondModuleTest from './GetSecondModule.test.ets'; import isDefaultApplicationTest from './IsDefaultApplication.test.ets'; import PublicApiEightTest from './PublicApiEightTest.test.ets'; +import PublicApiNineTest from './PublicApiNineTest.test.ets'; export default function testsuite() { getProfileByAbility(); @@ -27,4 +28,5 @@ export default function testsuite() { getSecondModuleTest(); isDefaultApplicationTest(); PublicApiEightTest(); + PublicApiNineTest(); } \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/PublicApiNineTest.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/PublicApiNineTest.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..701935567f8cc42cfb56871b233f699d7cca6663 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/PublicApiNineTest.test.ets @@ -0,0 +1,113 @@ +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impligetProfileByAbilityEmptyAbilityCalled. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import bundle from '@ohos.bundle.bundleManager'; +import defaultAppMgr from '@ohos.bundle.defaultAppManager'; +import util from "./Utils"; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"; + +const BUNDLE_NAME = "ohos.acts.bundle.stage.test"; +const MODULE_NAME = "testModule"; +const METADATA_NAME = "ohos.ability.form"; +const METADATA_NAME1 = "ohos.extension.form1"; +const ABILITY_NAME = "ohos.acts.bundle.stage.test.MainAbility"; +const ABILITY_NAME1 = "Form"; +const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainAbility/pages/second/second\"]}"; + +export default function PublicApiNineTest() { + describe('PublicApiNineTest', function () { + + /* + * @tc.number: SUB_BMS_SYSTEMAPI_RUNNIING_0069 + * @tc.name: getBundleInfoForSelfProTest + * @tc.desc: Test getBundleInfoForSelf of API9 in version9 normal project + */ + it('getBundleInfoForSelfProTest', 0, async function (done) { + await bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_DEFAULT).then(data => { + util.info("getBundleInfoForSelfPro" + JSON.stringify(data)); + expect(data.name).assertEqual(BUNDLE_NAME); + }).catch(err => { + util.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + }) + bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_DEFAULT, (err, data) => { + expect(data.name).assertEqual(BUNDLE_NAME); + expect(err).assertEqual(null); + done(); + }) + }); + + /* + * @tc.number: SUB_BMS_SYSTEMAPI_RUNNIING_0070 + * @tc.name: getProfileByAbilityTest + * @tc.desc: Test getProfileByAbility of API9 in version9 normal project + */ + it('getProfileByAbilityTest', 0, async function (done) { + await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME).then(data => { + util.info('getProfileByAbility promise data is: ' + JSON.stringify(data)); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + }).catch(err => { + util.info('getProfileByAbility failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + }) + bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME, (err, data) => { + util.info('getProfileByAbility failed. Cause: ' + JSON.stringify(err)); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + done(); + }) + }); + + /* + * @tc.number: SUB_BMS_SYSTEMAPI_RUNNIING_0071 + * @tc.name: getProfileByExtensionAbilityTest + * @tc.desc: Test getProfileByExtensionAbility of API9 in version9 normal project + */ + it('getProfileByExtensionAbilityPromise', 0, async function (done) { + await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME1, METADATA_NAME1).then(data => { + util.info('getProfileByExtensionAbility promise data is: ' + JSON.stringify(data)); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + }).catch(err => { + util.info('getProfileByExtensionAbility failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + }) + bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME1, METADATA_NAME1, (err, data) => { + util.info('getProfileByExtensionAbility failed. Cause: ' + JSON.stringify(err)); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + done(); + }) + }); + + /** + * @tc.number: SUB_BMS_SYSTEMAPI_RUNNIING_0072 + * @tc.name: isDefaultApplicationTest + * @tc.desc: Test isDefaultApplication of API9 in version9 normal project + */ + it('isDefaultApplication_0100', 0, async function (done) { + await defaultAppMgr.isDefaultApplication(defaultAppMgr.ApplicationType.IMAGE).then(data => { + expect(data).assertFalse() + }).catch(err => { + expect().assertFail(); + }) + defaultAppMgr.isDefaultApplication(defaultAppMgr.ApplicationType.IMAGE, (err, data) => { + util.info("isDefaultApplication_0100 data--- " + data) + util.info("isDefaultApplication_0100 err--- " + err) + expect(data).assertFalse() + expect(err).assertEqual(null) + done() + }) + }); + + }) +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/AppScope/app.json b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..c0f0ddca54d89596fc019a45040b528314a39ca7 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app":{ + "bundleName":"ohos.acts.bundle.overlay.test", + "vendor":"huawei", + "versionCode":1000000, + "versionName":"1.0.0", + "debug":false, + "icon":"$media:icon", + "label":"$string:app_name", + "description":"$string:description_application", + "distributedNotificationEnabled":true, + "keepAlive":true, + "singleUser":true, + "minAPIVersion":9, + "targetAPIVersion":9, + "car":{ + "apiCompatibleVersion":9, + "singleUser":false + } + } +} diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/AppScope/resources/base/element/string.json b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..ee69f9a861d9dc269ed6638735d52674583498e1 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"ohosProject" + } + ] +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/BUILD.gn b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..f9b25070e3c01cc9eea89b87d4fdce1b246cb96e --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/BUILD.gn @@ -0,0 +1,42 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_hap_assist_suite("bmsOverlayDemo") { + hap_profile = "entry/src/main/module.json" + hap_name = "bmsOverlayDemo" + subsystem_name = "bundlemanager" + part_name = "bundle_framework" + testonly = true + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "signature/openharmony_sx.p7b" +} + +ohos_app_scope("bmsoverlaydemo_app_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "entry/src/main/ets" +} + +ohos_resources("hjs_demo_resources") { + sources = [ "entry/src/main/resources" ] + deps = [ ":bmsoverlaydemo_app_profile" ] + hap_profile = "entry/src/main/module.json" +} diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/Test.json b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..26909f2889de98a479f076f87725fed805c7a343 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/Test.json @@ -0,0 +1,4 @@ +{ + "description": "Configuration for hjunit demo Tests", +} + diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/Application/AbilityStage.ts b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 0000000000000000000000000000000000000000..cbcc939ff5d038c8e22947c2f0186d3407e691bc --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,9 @@ +import AbilityStage from "@ohos.app.ability.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("[Demo] MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/FormAbility/FormAbility.ts b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/FormAbility/FormAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..d443631109f5f73817ec907b36c1b7a3d353d357 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/FormAbility/FormAbility.ts @@ -0,0 +1,37 @@ +import FormExtension from '@ohos.app.form.FormExtensionAbility'; +import formBindingData from '@ohos.application.formBindingData'; +import formInfo from '@ohos.application.formInfo'; + +export default class FormAbility extends FormExtension { + onCreate(want) { + // Called to return a FormBindingData object. + let formData = {}; + return formBindingData.createFormBindingData(formData); + } + + onCastToNormal(formId) { + // Called when the form provider is notified that a temporary form is successfully + // converted to a normal form. + } + + onUpdate(formId) { + // Called to notify the form provider to update a specified form. + } + + onVisibilityChange(newStatus) { + // Called when the form provider receives form events from the system. + } + + onEvent(formId, message) { + // Called when a specified message event defined by the form provider is triggered. + } + + onDestroy(formId) { + // Called to notify the form provider that a specified form has been destroyed. + } + + onAcquireFormState(want) { + // Called to return a {@link FormState} object. + return formInfo.FormState.READY; + } +}; \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/MainAbility/MainAbility.ts b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..266fcd85946409e0f8652dbb84fe4830200f35bc --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,36 @@ +import Ability from '@ohos.app.ability.UIAbility' + +export default class MainAbility extends Ability { + onCreate(want,launchParam){ + // Ability is creating, initialize resources for this ability + console.log("[Demo] MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("[Demo] MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + //Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility onBackground") + } +}; \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/ServiceAbility/FormAbility.ts b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/ServiceAbility/FormAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..d443631109f5f73817ec907b36c1b7a3d353d357 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/ServiceAbility/FormAbility.ts @@ -0,0 +1,37 @@ +import FormExtension from '@ohos.app.form.FormExtensionAbility'; +import formBindingData from '@ohos.application.formBindingData'; +import formInfo from '@ohos.application.formInfo'; + +export default class FormAbility extends FormExtension { + onCreate(want) { + // Called to return a FormBindingData object. + let formData = {}; + return formBindingData.createFormBindingData(formData); + } + + onCastToNormal(formId) { + // Called when the form provider is notified that a temporary form is successfully + // converted to a normal form. + } + + onUpdate(formId) { + // Called to notify the form provider to update a specified form. + } + + onVisibilityChange(newStatus) { + // Called when the form provider receives form events from the system. + } + + onEvent(formId, message) { + // Called when a specified message event defined by the form provider is triggered. + } + + onDestroy(formId) { + // Called to notify the form provider that a specified form has been destroyed. + } + + onAcquireFormState(want) { + // Called to return a {@link FormState} object. + return formInfo.FormState.READY; + } +}; \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/pages/index/index.ets b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/pages/index/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..7974e5d93b5154d6fdf9609f18c2168ff4fd7d60 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/pages/index/index.ets @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import file from '@system.file'; + +import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets" +import testsuite from "../../test/List.test.ets" + + +@Entry +@Component +struct Index { + + aboutToAppear(){ + console.info("start run testcase!!!!") + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + core.addService('expect', expectExtend) + const reportExtend = new ReportExtend(file) + + core.addService('report', reportExtend) + core.init() + core.subscribeEvent('task', reportExtend) + const configService = core.getDefaultService('config') + console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters)) + globalThis.abilityWant.parameters.timeout = 70000; + configService.setConfig(globalThis.abilityWant.parameters) + testsuite(globalThis.abilityContext) + core.execute() + } + + build() { + Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World') + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(25) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/pages/second/second.ets b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/pages/second/second.ets new file mode 100644 index 0000000000000000000000000000000000000000..1c1c727ff11ecc97909f482c35268db87ae23bb4 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/pages/second/second.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; + +@Entry +@Component +struct Second { + private content: string = "Second Page" + + build() { + Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('back to index') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/test/List.test.ets b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..193419242c9869f76b7cb16e2999f5d76ec6da9c --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +export default function testsuite(context) { + + +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/module.json b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..d0bc5fa85a75b04cbb2ef63125a5f927e8e014e6 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/module.json @@ -0,0 +1,25 @@ +{ + "module": { + "name": "stage1", + "type": "feature", + "targetModuleName": "entry1", + "targetPriority": 1, + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "false" + } + ] + } +} diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/element/string.json b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c9962d9e060b2701436e65408ad934b871cd1867 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/element/string.json @@ -0,0 +1,40 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + }, + { + "name": "form_FormAbility_desc", + "value": "form_description" + }, + { + "name": "form_FormAbility_label", + "value": "form_label" + } + ] +} diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/media/icon.png b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..474a55588fd7216113dd42073aadf254d4dba023 Binary files /dev/null and b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/media/icon.png differ diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/profile/form_config.json b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/profile/form_config.json new file mode 100644 index 0000000000000000000000000000000000000000..4dfa0a89fba365ef2240e563cef1f6b1b884c937 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/profile/form_config.json @@ -0,0 +1,77 @@ +{ + "forms": [ + { + "isDefault": true, + "scheduledUpdateTime": "10:30", + "defaultDimension": "2*2", + "name": "widget", + "description": "This is a service widget.", + "colorMode": "auto", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "formConfigAbility": "ability://xxxxx", + "supportDimensions": [ + "2*2" + ], + "updateEnabled": true, + "updateDuration": 1 + }, + { + "isDefault": true, + "scheduledUpdateTime": "10:30", + "defaultDimension": "2*2", + "name": "widget1", + "description": "This is a service widget.", + "colorMode": "auto", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "formConfigAbility": "ability://xxxxx", + "supportDimensions": [ + "1*2", + "2*2" + ], + "updateEnabled": true, + "updateDuration": 1 + }, + { + "isDefault": true, + "scheduledUpdateTime": "10:30", + "defaultDimension": "2*2", + "name": "widget2", + "description": "This is a service widget.", + "colorMode": "auto", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "formConfigAbility": "ability://xxxxx", + "supportDimensions": [ + "2*2" + ], + "updateEnabled": true, + "updateDuration": 1 + }, + { + "isDefault": true, + "scheduledUpdateTime": "10:30", + "defaultDimension": "2*2", + "name": "widget3", + "description": "This is a service widget.", + "colorMode": "auto", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "formConfigAbility": "ability://xxxxx", + "supportDimensions": [ + "2*2" + ], + "updateEnabled": true, + "updateDuration": 1 + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/resources/base/profile/main_pages.json b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/resources/base/profile/main_pages.json rename to bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/profile/main_pages.json diff --git a/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/signature/openharmony_sx.p7b b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..8da769dd128eb963811a16a46f1168eb500cf789 Binary files /dev/null and b/bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/signature/openharmony_sx.p7b differ diff --git a/commonlibrary/ets_utils/containerLine_lib_standard/src/main/js/test/ArrayList.test.js b/commonlibrary/ets_utils/containerLine_lib_standard/src/main/js/test/ArrayList.test.js index 714a48b74dcc0e04c92585729c7152b68db62a00..379e5e59762bf9b956aa156d9a85c35995fe7748 100644 --- a/commonlibrary/ets_utils/containerLine_lib_standard/src/main/js/test/ArrayList.test.js +++ b/commonlibrary/ets_utils/containerLine_lib_standard/src/main/js/test/ArrayList.test.js @@ -1115,5 +1115,121 @@ describe("ArraylistTest", function () { expect(err.message).assertEqual(`The type of "fromIndex" must be number. Received value is: a`); } }); + + /** + * @tc.name: testHas059 + * @tc.desc: Check whether the ArrayList contains a specified element. + * For example: arrayList.has.bind({})(). + */ + it('testHas059', 0, function () { + let arrayList = new ArrayList(); + try { + arrayList.has.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The has method cannot be bound`); + } + }); + + /** + * @tc.name: testRemoveByIndex060 + * @tc.desc: In the ArrayList instance, delete the element based on its index. + * For example: arrayList.removeByIndex.bind({})(). + */ + it('testRemoveByIndex060', 0, function () { + let arrayList = new ArrayList(); + try { + arrayList.removeByIndex.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The removeByIndex method cannot be bound`); + } + }); + + /** + * @tc.name: testRemove061 + * @tc.desc: Delete the specified element . For example: arrayList.remove.bind({})(). + */ + it('testRemove061', 0, function () { + let arrayList = new ArrayList(); + try { + arrayList.remove.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The remove method cannot be bound`); + } + }); + + /** + * @tc.name: testForEach062 + * @tc.desc: Traversing elements in an ArrayList instance. + * For example: arrayList.forEach.bind({}, "a")(() => {}). + */ + it('testForEach062', 0, function () { + let arrayList = new ArrayList(); + try { + arrayList.forEach.bind({}, "a")(() => {}); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The forEach method cannot be bound`); + } + }); + + /** + * @tc.name: testForEach063 + * @tc.desc: Traversing elements in an ArrayList instance. + * For example: arrayList.forEach(11). + */ + it('testForEach063', 0, function () { + let arrayList = new ArrayList(); + try { + arrayList.forEach(11); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(401); + expect(err.message).assertEqual(`The type of "callbackfn" must be callable. Received value is: 11`); + } + }); + + /** + * @tc.name: testClear064 + * @tc.desc: Clear all elements in the ArrayList instance. For example: arrayList.clear.bind({}, "a")(). + */ + it('testClear064', 0, function () { + let arrayList = new ArrayList(); + try { + arrayList.clear.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The clear method cannot be bound`); + } + }); + + /** + * @tc.name: testIsEmpty065 + * @tc.desc: Determine whether the ArrayList instance is empty. For example: arrayList.isEmpty.bind({}, "a")(). + */ + it('testIsEmpty065', 0, function () { + let arrayList = new ArrayList(); + try { + arrayList.isEmpty.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The isEmpty method cannot be bound`); + } + }); }); } diff --git a/commonlibrary/ets_utils/containerLine_lib_standard/src/main/js/test/List.test.js b/commonlibrary/ets_utils/containerLine_lib_standard/src/main/js/test/List.test.js index 1129c445c452412373b399ca545f7321ae8e480d..470b0c64319be66159ed2296481a6976b84b8901 100644 --- a/commonlibrary/ets_utils/containerLine_lib_standard/src/main/js/test/List.test.js +++ b/commonlibrary/ets_utils/containerLine_lib_standard/src/main/js/test/List.test.js @@ -1145,5 +1145,69 @@ describe("ListTest", function () { expect(err.message).assertEqual(`The type of "fromIndex" must be number. Received value is: a`); } }); + + /** + * @tc.name: testAdd072 + * @tc.desc: Add a element to the end of the List instance. For example: list.add.bind({}, "a")(). + */ + it('testAdd072', 0, function () { + let list = new List(); + try { + list.add.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The add method cannot be bound`); + } + }); + + /** + * @tc.name: testForEach073 + * @tc.desc: Traversing elements in an List instance. For example: list.forEach(11). + */ + it('testForEach073', 0, function () { + let list = new List(); + try { + list.forEach(11); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(401); + expect(err.message).assertEqual(`The type of "callbackfn" must be callable. Received value is: 11`); + } + }); + + /** + * @tc.name: testForEach074 + * @tc.desc: Traversing elements in an List instance. For example: list.forEach.bind({}, "a")(). + */ + it('testForEach074', 0, function () { + let list = new List(); + try { + list.forEach.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The forEach method cannot be bound`); + } + }); + + /** + * @tc.name: testIsEmpty075 + * @tc.desc: Determine whether the List instance is empty. For example: list.isEmpty.bind({}, "a")(). + */ + it('testIsEmpty075', 0, function () { + let list = new List(); + try { + list.isEmpty.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The isEmpty method cannot be bound`); + } }); +}); } diff --git a/commonlibrary/ets_utils/containerLine_lib_standard/src/main/js/test/Stack.test.js b/commonlibrary/ets_utils/containerLine_lib_standard/src/main/js/test/Stack.test.js index 9ca58c62a77974f07327c2a08a5d795afebfb1c8..3788d3591964876243e6b39d7d95816fef65bb99 100644 --- a/commonlibrary/ets_utils/containerLine_lib_standard/src/main/js/test/Stack.test.js +++ b/commonlibrary/ets_utils/containerLine_lib_standard/src/main/js/test/Stack.test.js @@ -496,5 +496,37 @@ describe("StackTest", function () { expect(err.message).assertEqual(`The push method cannot be bound`); } }); + + /** + * @tc.name: testIsEmpty037 + * @tc.desc: Determine whether the Stack instance is empty. For example: stack.isEmpty.bind({}, "a")(). + */ + it('testIsEmpty037', 0, function () { + let stack = new Stack(); + try { + stack.isEmpty.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The isEmpty method cannot be bound`); + } + }); + + /** + * @tc.name: testPop038 + * @tc.desc: Delete top of stack element. For example: stack.pop.bind({}, "a")(). + */ + it('testPop038', 0, function () { + let stack = new Stack(); + try { + stack.pop.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The pop method cannot be bound`); + } + }); }); } diff --git a/commonlibrary/ets_utils/containerRelation_lib_standard/src/main/js/test/HashMap.test.js b/commonlibrary/ets_utils/containerRelation_lib_standard/src/main/js/test/HashMap.test.js index b55f17be7575f62e13298cd9c7da4da7121297b8..d190838fb30e9177f37c512a8b59379361171e43 100644 --- a/commonlibrary/ets_utils/containerRelation_lib_standard/src/main/js/test/HashMap.test.js +++ b/commonlibrary/ets_utils/containerRelation_lib_standard/src/main/js/test/HashMap.test.js @@ -740,5 +740,117 @@ describe("HashMapTest", function () { expect(err.message).assertEqual(`The set method cannot be bound`); } }); + + /** + * @tc.name: testIsEmpty050 + * @tc.desc: Determine whether the HashMap instance is empty. For example: hashMap.isEmpty.bind({}, "a")(). + */ + it('testIsEmpty050', 0, function () { + let hashMap = new HashMap(); + try { + hashMap.isEmpty.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The isEmpty method cannot be bound`); + } + }); + + /** + * @tc.name: testHasKey051 + * @tc.desc: Determine whether the HashMap contains the specified key. For example: hashMap.hasKey.bind({}, "a")(). + */ + it('testHasKey051', 0, function () { + let hashMap = new HashMap(); + try { + hashMap.hasKey.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The hasKey method cannot be bound`); + } + }); + + /** + * @tc.name: testGet052 + * @tc.desc: Get the corresponding value through the key. For example: hashMap.get.bind({}, "a")(). + */ + it('testGet052', 0, function () { + let hashMap = new HashMap(); + try { + hashMap.get.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The get method cannot be bound`); + } + }); + + /** + * @tc.name: testSet053 + * @tc.desc: Add a pair of key value pairs to the HashMap. For example: hashMap.set(undefined, 11). + */ + it('testSet053', 0, function () { + let hashMap = new HashMap(); + try { + hashMap.set(undefined, 11); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(401); + expect(err.message).assertEqual(`The type of "key" must be Key of JS. Received value is: undefined`); + } + }); + + /** + * @tc.name: testRemove054 + * @tc.desc: Delete key value pairs according to key. For example: hashMap.remove.bind({}, "a")(). + */ + it('testRemove054', 0, function () { + let hashMap = new HashMap(); + try { + hashMap.remove.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The remove method cannot be bound`); + } + }); + + /** + * @tc.name: testForEach055 + * @tc.desc: Traverse all key value pairs in the HashMap instance.For example: hashMap.forEach.bind({}, "a")(). + */ + it('testForEach055', 0, function () { + let hashMap = new HashMap(); + try { + hashMap.forEach.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The forEach method cannot be bound`); + } + }); + + /** + * @tc.name: testForEach056 + * @tc.desc: Traverse all key value pairs in the HashMap instance.For example: hashMap.forEach(11). + */ + it('testForEach056', 0, function () { + let hashMap = new HashMap(); + try { + hashMap.forEach(11); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(401); + expect(err.message).assertEqual(`The type of "callbackfn" must be callable. Received value is: 11`); + } + }); }); } diff --git a/commonlibrary/ets_utils/containerRelation_lib_standard/src/main/js/test/HashSet.test.js b/commonlibrary/ets_utils/containerRelation_lib_standard/src/main/js/test/HashSet.test.js index a85e60c47eff838646ce91a258b68d7fd7a96b69..43bd49d530e94bdd1b295097c798beb10ed1ff59 100644 --- a/commonlibrary/ets_utils/containerRelation_lib_standard/src/main/js/test/HashSet.test.js +++ b/commonlibrary/ets_utils/containerRelation_lib_standard/src/main/js/test/HashSet.test.js @@ -540,5 +540,55 @@ describe("HashSetTest", function () { expect(err.message).assertEqual(`The add method cannot be bound`); } }); + + /** + * @tc.name: testIsEmpty034 + * @tc.desc: Determine whether the HashSet instance is empty. For example: hashSet.isEmpty.bind({}, "a")(). + */ + it('testIsEmpty034', 0, function () { + let hashSet = new HashSet(); + try { + hashSet.isEmpty.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The isEmpty method cannot be bound`); + } + }); + + /** + * @tc.name: testForEach035 + * @tc.desc: Traverse the collection of all elements of the HashSet instance. + * For example: hashSet.forEach.bind({}, "a")(). + */ + it('testForEach035', 0, function () { + let hashSet = new HashSet(); + try { + hashSet.forEach.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The forEach method cannot be bound`); + } + }); + + /** + * @tc.name: testForEach036 + * @tc.desc: Traverse the collection of all elements of the HashSet instance. + * For example: hashSet.forEach(11). + */ + it('testForEach036', 0, function () { + let hashSet = new HashSet(); + try { + hashSet.forEach(11); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(401); + expect(err.message).assertEqual(`The type of "callbackfn" must be callable. Received value is: 11`); + } + }); }); } diff --git a/commonlibrary/ets_utils/containerRelation_lib_standard/src/main/js/test/TreeSet.test.js b/commonlibrary/ets_utils/containerRelation_lib_standard/src/main/js/test/TreeSet.test.js index 3ce7a468e92247e1796d6905886f14bb031339cf..a6ea030bf991f379c4a019b9c47922b41871b9ec 100644 --- a/commonlibrary/ets_utils/containerRelation_lib_standard/src/main/js/test/TreeSet.test.js +++ b/commonlibrary/ets_utils/containerRelation_lib_standard/src/main/js/test/TreeSet.test.js @@ -537,5 +537,139 @@ describe("TreeSetTest", function () { expect(err.message).assertEqual(`The add method cannot be bound`); } }); + + /** + * @tc.name: testClear039 + * @tc.desc: Clear all elements of the TreeSet instance. For example: treeSet.clear.bind({}, "a")(). + */ + it('testClear039', 0, function () { + let treeSet = new TreeSet(); + try { + treeSet.clear.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The clear method cannot be bound`); + } + }); + + /** + * @tc.name: testGetLowerValue040 + * @tc.desc: Get a value that is a little lower than the specified value sort. + * For example: treeSet.getLowerValue.bind({}, "a")(). + */ + it('testGetLowerValue040', 0, function () { + let treeSet = new TreeSet(); + try { + treeSet.getLowerValue.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The getLowerValue method cannot be bound`); + } + }); + + /** + * @tc.name: testGetLowerValue041 + * @tc.desc: Get a value that is a little lower than the specified value sort. + * For example: treeSet.getLowerValue(null). + */ + it('testGetLowerValue041', 0, function () { + let treeSet = new TreeSet(); + try { + treeSet.getLowerValue(null); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(401); + expect(err.message).assertEqual(`The type of "key" must be not null. Received value is: null`); + } + }); + + /** + * @tc.name: testGetHigherValue042 + * @tc.desc: Get a value that is a little higher than the specified value sort. + * For example: treeSet.getHigherValue(null). + */ + it('testGetHigherValue042', 0, function () { + let treeSet = new TreeSet(); + try { + treeSet.getHigherValue(null); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(401); + expect(err.message).assertEqual(`The type of "key" must be not null. Received value is: null`); + } + }); + + /** + * @tc.name: testGetHigherValue043 + * @tc.desc: Get a value that is a little higher than the specified value sort. + * For example: treeSet.getHigherValue.bind({}, "a")(). + */ + it('testGetHigherValue043', 0, function () { + let treeSet = new TreeSet(); + try { + treeSet.getHigherValue.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The getHigherValue method cannot be bound`); + } + }); + + /** + * @tc.name: testForEach044 + * @tc.desc: Traverse the collection of all elements of the TreeSet instance. + * For example: treeSet.forEach.bind({}, "a")(). + */ + it('testForEach044', 0, function () { + let treeSet = new TreeSet(); + try { + treeSet.forEach.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The forEach method cannot be bound`); + } + }); + + /** + * @tc.name: testForEach045 + * @tc.desc: Traverse the collection of all elements of the TreeSet instance. + * For example: treeSet.forEach(11). + */ + it('testForEach045', 0, function () { + let treeSet = new TreeSet(); + try { + treeSet.forEach(11); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(401); + expect(err.message).assertEqual(`The type of "callbackfn" must be callable. Received value is: 11`); + } + }); + + /** + * @tc.name: testValues046 + * @tc.desc: Get a collection of all the values in the TreeSet. For example: treeSet.values.bind({}, "a")(). + */ + it('testValues046', 0, function () { + let treeSet = new TreeSet(); + try { + treeSet.values.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The Symbol.iterator method cannot be bound`); + } + }); }); } diff --git a/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/test/ThreadWorker.test.js b/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/test/ThreadWorker.test.js index 325d74e06154c973a1d153231e147d87275854af..c88b0abc86e8492aeeddcbc59689d952946ae0a8 100644 --- a/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/test/ThreadWorker.test.js +++ b/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/test/ThreadWorker.test.js @@ -459,20 +459,52 @@ describe('threadWorkerTest', function () { done() }) - // check worker handle error is ok + // check worker handle error is ok /** * @tc.name: threadWorker_postMessage_test_007 * @tc.desc: Sends a message to the worker thread when throw error. */ it('threadWorker_postMessage_test_007', 0, async function (done) { + let ss = new worker.ThreadWorker("entry/ets/workers/newworker_007.js"); + let isTerminate = false; + ss.onexit = function () { + isTerminate = true; + } try { - const ss = new worker.ThreadWorker("entry/ets/workers/newworker_007.js") - ss.postMessage() + ss.postMessage(); } catch (error) { - expect(error.name).assertEqual("BusinessError") - expect(error.message).assertEqual("Worker messageObject must be not null with postMessage") + ss.terminate(); + while (!isTerminate) { + await promiseCase(); + } + expect(error.name).assertEqual("BusinessError"); + expect(error.message).assertEqual("Worker messageObject must be not null with postMessage"); } - done() + done(); + }) + + // check worker handle error is ok + /** + * @tc.name: threadWorker_postMessage_test_008 + * @tc.desc: Sends a message to the worker thread when throw error. + */ + it('threadWorker_postMessage_test_008', 0, async function (done) { + let ss = new worker.ThreadWorker("entry/ets/workers/newworker_007.js"); + let isTerminate = false; + ss.onexit = function () { + isTerminate = true; + } + try { + ss.postMessage("123", "123"); + } catch (error) { + ss.terminate(); + while (!isTerminate) { + await promiseCase(); + } + expect(error.name).assertEqual("BusinessError"); + expect(error.message).assertEqual("transfer list must be an Array"); + } + done(); }) // check worker terminate is ok @@ -2298,7 +2330,7 @@ describe('threadWorkerTest', function () { const data = Symbol(); ss.postMessage(data); } catch (error) { - console.info("worker:: recv error message: " + error.message) + console.info("worker:: recv error message: " + error.message); while (!flag) { await promiseCase(); } @@ -2310,5 +2342,115 @@ describe('threadWorkerTest', function () { expect(flag).assertTrue(); done(); }) + + // Check the postmessage of worker is ok. + /** + * @tc.name: threadWorker_worker_postmessage_test_001 + * @tc.desc: Check the postmessage of worker is ok. + */ + it('threadWorker_worker_postmessage_test_001', 0, async function (done) { + let ss = new worker.ThreadWorker("entry/ets/workers/newworker_022.js"); + let res = ""; + let flag = false; + let isTerminate = false; + ss.onmessage = function (d) { + res = d.data; + flag = true; + } + ss.onexit = function() { + isTerminate = true; + } + ss.postMessage("1"); + while (!flag) { + await promiseCase(); + } + ss.terminate(); + while (!isTerminate) { + await promiseCase(); + } + expect(res).assertEqual("Worker param count must be more than 1 with new"); + done(); + }) + + + // Check the postmessage of worker is ok. + /** + * @tc.name: threadWorker_worker_postmessage_test_002 + * @tc.desc: Check the postmessage of worker is ok. + */ + it('threadWorker_worker_postmessage_test_002', 0, async function (done) { + let ss = new worker.ThreadWorker("entry/ets/workers/newworker_023.js"); + let res = ""; + let flag = false; + let isTerminate = false; + ss.onmessage = function (d) { + res = d.data; + flag = true; + } + ss.onexit = function() { + isTerminate = true; + } + ss.postMessage("1"); + while (!flag) { + await promiseCase(); + } + ss.terminate(); + while (!isTerminate) { + await promiseCase(); + } + expect(res).assertEqual("Transfer list must be an Array"); + done(); + }) + + // Check the postmessage of worker is ok. + /** + * @tc.name: threadWorker_worker_postmessage_test_003 + * @tc.desc: Check the postmessage of worker is ok. + */ + it('threadWorker_worker_postmessage_test_003', 0, async function (done) { + let ss = new worker.ThreadWorker("entry/ets/workers/newworker_024.js"); + let res = ""; + let flag = false; + let isTerminate = false; + ss.onmessage = function (d) { + res = d.data; + flag = true; + } + ss.onexit = function() { + isTerminate = true; + } + ss.postMessage("1") + while (!flag) { + await promiseCase(); + } + ss.terminate(); + while (!isTerminate) { + await promiseCase(); + } + expect(res).assertEqual("Serializing an uncaught exception failed, failed to serialize message."); + done(); + }) + + // Check the close of worker is ok. + /** + * @tc.name: threadWorker_worker_close_test_001 + * @tc.desc: Check the close of worker is ok. + */ + it('threadWorker_worker_close_test_001', 0, async function (done) { + let ss = new worker.ThreadWorker("entry/ets/workers/newworker_025.js"); + let res = 0; + let isTerminate = false; + ss.onexit = function() { + res += 1 + isTerminate = true; + } + ss.postMessage("1"); + while (!isTerminate) { + await promiseCase(); + } + + expect(res == 1).assertTrue(); + done(); + }) }) } \ No newline at end of file diff --git a/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker.js b/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker.js index 2b681336776eebc089730439a0ffea7bff73df21..273f39f1e8cfcc4b079d6c1c6d63a1a997f34747 100644 --- a/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker.js +++ b/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker.js @@ -16,11 +16,7 @@ import worker from '@ohos.worker'; const parentPort = worker.workerPort; -console.info("worker:: new version") - -parentPort.onclose = function() { - console.info("worker::worker.js onclose"); -} +console.info("worker:: new version"); parentPort.onmessage = function(e) { let data = e.data; diff --git a/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker_022.js b/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker_022.js new file mode 100644 index 0000000000000000000000000000000000000000..98e130d4a2704870f4aba58b0fa4ef0014669f8a --- /dev/null +++ b/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker_022.js @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import worker from '@ohos.worker'; +const workerPort = worker.workerPort; + +workerPort.onmessage = function(e) { + try { + workerPort.postMessage(); + } catch (e) { + let data = e.message; + workerPort.postMessage(data); + } +} \ No newline at end of file diff --git a/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker_023.js b/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker_023.js new file mode 100644 index 0000000000000000000000000000000000000000..b36ebc2f0f9386448c0f16e9a629ae7421f34c1e --- /dev/null +++ b/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker_023.js @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import worker from '@ohos.worker'; +const workerPort = worker.workerPort; + +workerPort.onmessage = function(e) { + try { + workerPort.postMessage("123", "123"); + } catch (e) { + let data = e.message; + workerPort.postMessage(data); + } +} \ No newline at end of file diff --git a/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker_024.js b/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker_024.js new file mode 100644 index 0000000000000000000000000000000000000000..8c42d9ef4d4a802561c89fc87cfc9277b739a49f --- /dev/null +++ b/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker_024.js @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import worker from '@ohos.worker'; +const workerPort = worker.workerPort; + +workerPort.onmessage = function(e) { + try { + const symbol = Symbol(); + workerPort.postMessage(symbol); + } catch (e) { + let data = e.message; + workerPort.postMessage(data); + } +} \ No newline at end of file diff --git a/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker_025.js b/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker_025.js new file mode 100644 index 0000000000000000000000000000000000000000..7c581a693f73920d8a40f807c6005859559301cf --- /dev/null +++ b/commonlibrary/ets_utils/threadWorker_lib_standard/entry/src/main/ets/workers/newworker_025.js @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import worker from '@ohos.worker'; +const workerPort = worker.workerPort; + +workerPort.onmessage = function(e) { + workerPort.close(); +} \ No newline at end of file diff --git a/communication/bluetooth_ble/src/main/js/test/BleAdvertiser.test.js b/communication/bluetooth_ble/src/main/js/test/BleAdvertiser.test.js index c748666b308e74e1c2ac504df965038e8d7ebbb9..006c6f73b87fbeec52e461da1f5a9fe319fd1b76 100644 --- a/communication/bluetooth_ble/src/main/js/test/BleAdvertiser.test.js +++ b/communication/bluetooth_ble/src/main/js/test/BleAdvertiser.test.js @@ -15,6 +15,11 @@ */ import bluetooth from '@ohos.bluetooth'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' @@ -31,7 +36,7 @@ describe('bluetoothBLETest2', function() { case 0: console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(1000); break; case 1: console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta)); @@ -43,12 +48,38 @@ describe('bluetoothBLETest2', function() { case 3: console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(1000); break; default: console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') gattServer = bluetooth.BLE.createGattServer(); diff --git a/communication/bluetooth_ble/src/main/js/test/BleGattManager.test.js b/communication/bluetooth_ble/src/main/js/test/BleGattManager.test.js index 91d39d7060daf6a088c00e2b9ef78c8e02d2f870..f1841e59a25c54167aa944677e23fb7eecd15fca 100644 --- a/communication/bluetooth_ble/src/main/js/test/BleGattManager.test.js +++ b/communication/bluetooth_ble/src/main/js/test/BleGattManager.test.js @@ -14,6 +14,11 @@ */ import bluetooth from '@ohos.bluetooth'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' export default function bluetoothBLETest() { @@ -30,7 +35,7 @@ describe('bluetoothBLETest', function() { case 0: console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); break; case 1: console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta)); @@ -42,12 +47,38 @@ describe('bluetoothBLETest', function() { case 3: console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(1000); break; default: console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') gattServer = bluetooth.BLE.createGattServer(); diff --git a/communication/bluetooth_ble/src/main/js/test/BleService.test.js b/communication/bluetooth_ble/src/main/js/test/BleService.test.js index b8360840c10b2b68935d0d340363a9123e27ed40..50cd72c51b77f5e76264c197342394aa5c2b388f 100644 --- a/communication/bluetooth_ble/src/main/js/test/BleService.test.js +++ b/communication/bluetooth_ble/src/main/js/test/BleService.test.js @@ -14,6 +14,11 @@ */ import bluetooth from '@ohos.bluetooth'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' export default function bluetoothBLETest1() { @@ -31,7 +36,7 @@ describe('bluetoothBLETest1', function() { case 0: console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); break; case 1: console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta)); @@ -43,12 +48,38 @@ describe('bluetoothBLETest1', function() { case 3: console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); break; default: console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') gattServer = bluetooth.BLE.createGattServer(); diff --git a/communication/bluetooth_manager/src/main/js/test/BleAdvertiser.test.js b/communication/bluetooth_manager/src/main/js/test/BleAdvertiser.test.js index 71ea19e33ef3e3788abc4c999034df05ceaca177..78f8fa93fe87cd15ce190bda595757159f9e7299 100644 --- a/communication/bluetooth_manager/src/main/js/test/BleAdvertiser.test.js +++ b/communication/bluetooth_manager/src/main/js/test/BleAdvertiser.test.js @@ -15,6 +15,11 @@ */ import bluetooth from '@ohos.bluetoothManager'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' @@ -31,7 +36,7 @@ describe('bluetoothBLETest2', function() { case 0: console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); break; case 1: console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta)); @@ -43,12 +48,38 @@ describe('bluetoothBLETest2', function() { case 3: console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); break; default: console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(async function (done) { console.info('beforeAll called') await tryToEnableBt() diff --git a/communication/bluetooth_manager/src/main/js/test/BleAdvertiser401.test.js b/communication/bluetooth_manager/src/main/js/test/BleAdvertiser401.test.js index e770c8ff82b68bbaa1a2c02511b3338974708d04..264422a7a2afb3275b2a35c7d9a79c414b118b00 100644 --- a/communication/bluetooth_manager/src/main/js/test/BleAdvertiser401.test.js +++ b/communication/bluetooth_manager/src/main/js/test/BleAdvertiser401.test.js @@ -16,6 +16,11 @@ //import bluetooth from '@ohos.bluetooth'; import bluetooth from '@ohos.bluetoothManager'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' @@ -32,7 +37,7 @@ describe('bluetoothBLETest5', function() { case 0: console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); break; case 1: console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta)); @@ -44,12 +49,38 @@ describe('bluetoothBLETest5', function() { case 3: console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); break; default: console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(async function (done) { console.info('beforeAll called') await tryToEnableBt() diff --git a/communication/bluetooth_manager/src/main/js/test/BleGattManager.test.js b/communication/bluetooth_manager/src/main/js/test/BleGattManager.test.js index 5a86892e054d0f73073642947acd4d29347cac8a..b9c48a0c630bb42a14299fc8ca2154c8f6695d94 100644 --- a/communication/bluetooth_manager/src/main/js/test/BleGattManager.test.js +++ b/communication/bluetooth_manager/src/main/js/test/BleGattManager.test.js @@ -14,6 +14,11 @@ */ import bluetooth from '@ohos.bluetoothManager'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' export default function bluetoothBLETest() { @@ -30,7 +35,7 @@ describe('bluetoothBLETest', function() { case 0: console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); break; case 1: console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta)); @@ -42,12 +47,38 @@ describe('bluetoothBLETest', function() { case 3: console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); break; default: console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') gattServer = bluetooth.BLE.createGattServer(); diff --git a/communication/bluetooth_manager/src/main/js/test/BleGattManager401.test.js b/communication/bluetooth_manager/src/main/js/test/BleGattManager401.test.js index ed7b5f7c00cd6c65d009b89d644994a864bf8e25..089b48922dc725c3c4d633d531dd689d24e07558 100644 --- a/communication/bluetooth_manager/src/main/js/test/BleGattManager401.test.js +++ b/communication/bluetooth_manager/src/main/js/test/BleGattManager401.test.js @@ -15,6 +15,11 @@ //import bluetooth from '@ohos.bluetooth'; import bluetooth from '@ohos.bluetoothManager'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' export default function bluetoothBLETest4() { @@ -30,7 +35,7 @@ describe('bluetoothBLETest4', function() { case 0: console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); break; case 1: console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta)); @@ -42,12 +47,38 @@ describe('bluetoothBLETest4', function() { case 3: console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); break; default: console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') gattClient = bluetooth.BLE.createGattClientDevice("11:22:33:44:55:66"); diff --git a/communication/bluetooth_manager/src/main/js/test/BleScanResult.test.js b/communication/bluetooth_manager/src/main/js/test/BleScanResult.test.js index 066aae03fdea8dd8500f2f626b5ebe02ead29f2c..9c657379a1952190abc08eb77d1834b367335f88 100644 --- a/communication/bluetooth_manager/src/main/js/test/BleScanResult.test.js +++ b/communication/bluetooth_manager/src/main/js/test/BleScanResult.test.js @@ -14,6 +14,11 @@ */ import bluetooth from '@ohos.bluetoothManager'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' export default function bluetoothBLETest6() { @@ -27,7 +32,7 @@ describe('bluetoothBLETest6', function() { switch(sta){ case 0: bluetooth.enableBluetooth(); - await sleep(5000); + await sleep(10000); let sta1 = bluetooth.getState(); console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta1)); break; @@ -40,7 +45,7 @@ describe('bluetoothBLETest6', function() { break; case 3: bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); let sta2 = bluetooth.getState(); console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta2)); break; @@ -48,6 +53,32 @@ describe('bluetoothBLETest6', function() { console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') }) diff --git a/communication/bluetooth_manager/src/main/js/test/BleService.test.js b/communication/bluetooth_manager/src/main/js/test/BleService.test.js index 42c8d5d41df0ce2b14319cb65d3ddfdce825d783..fc42fa8591fd9ea9ad02eb884bf6649e43d96381 100644 --- a/communication/bluetooth_manager/src/main/js/test/BleService.test.js +++ b/communication/bluetooth_manager/src/main/js/test/BleService.test.js @@ -14,8 +14,88 @@ */ import bluetooth from '@ohos.bluetoothManager'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' +let BluetoothState = { + STATE_OFF: 0,STATE_TURNING_ON: 1, + STATE_ON: 2,STATE_TURNING_OFF: 3, + STATE_BLE_TURNING_ON: 4, STATE_BLE_ON: 5, + STATE_BLE_ON: 6 +}; + +let SppOption = {uuid: '00001810-0000-1000-8000-00805F9B34FB', + secure: true, type: bluetooth.SppType.SPP_RFCOMM}; + +let MajorMinorClass = { + COMPUTER_UNCATEGORIZED : 0x0100,COMPUTER_DESKTOP : 0x0104, + COMPUTER_SERVER : 0x0108,COMPUTER_LAPTOP : 0x010C, + COMPUTER_HANDHELD_PC_PDA : 0x0110,COMPUTER_PALM_SIZE_PC_PDA : 0x0114, + COMPUTER_WEARABLE : 0x0118,COMPUTER_TABLET : 0x011C, + PHONE_UNCATEGORIZED : 0x0200,PHONE_CELLULAR : 0x0204, + PHONE_CORDLESS : 0x0208,PHONE_SMART : 0x020C, + PHONE_MODEM_OR_GATEWAY : 0x0210,PHONE_ISDN : 0x0214, + NETWORK_FULLY_AVAILABLE : 0x0300,NETWORK_1_TO_17_UTILIZED : 0x0320, + NETWORK_17_TO_33_UTILIZED : 0x0340,NETWORK_33_TO_50_UTILIZED : 0x0360, + NETWORK_60_TO_67_UTILIZED : 0x0380,NETWORK_67_TO_83_UTILIZED : 0x03A0, + NETWORK_83_TO_99_UTILIZED : 0x03C0,NETWORK_NO_SERVICE : 0x03E0, + AUDIO_VIDEO_UNCATEGORIZED : 0x0400,AUDIO_VIDEO_WEARABLE_HEADSET: 0x0404, + AUDIO_VIDEO_HANDSFREE : 0x0408,AUDIO_VIDEO_MICROPHONE : 0x0410, + AUDIO_VIDEO_LOUDSPEAKER : 0x0414,AUDIO_VIDEO_HEADPHONES : 0x0418, + AUDIO_VIDEO_PORTABLE_AUDIO : 0x041C,AUDIO_VIDEO_CAR_AUDIO : 0x0420, + AUDIO_VIDEO_SET_TOP_BOX : 0x0424,AUDIO_VIDEO_HIFI_AUDIO : 0x0428, + AUDIO_VIDEO_VCR : 0x042C,AUDIO_VIDEO_VIDEO_CAMERA : 0x0430, + AUDIO_VIDEO_CAMCORDER : 0x0434,AUDIO_VIDEO_VIDEO_MONITOR : 0x0438, + AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER : 0x043C, + AUDIO_VIDEO_VIDEO_CONFERENCING : 0x0440,AUDIO_VIDEO_VIDEO_GAMING_TOY: 0x0448, + PERIPHERAL_NON_KEYBOARD_NON_POINTING : 0x0500, + PERIPHERAL_KEYBOARD : 0x0540,PERIPHERAL_POINTING_DEVICE : 0x0580, + PERIPHERAL_KEYBOARD_POINTING : 0x05C0,PERIPHERAL_UNCATEGORIZED : 0x0500, + PERIPHERAL_JOYSTICK : 0x0504,PERIPHERAL_GAMEPAD : 0x0508, + PERIPHERAL_REMOTE_CONTROL : 0x05C0,PERIPHERAL_SENSING_DEVICE : 0x0510, + PERIPHERAL_DIGITIZER_TABLET : 0x0514, + PERIPHERAL_CARD_READER : 0x0518,PERIPHERAL_DIGITAL_PEN : 0x051C, + PERIPHERAL_SCANNER_RFID : 0x0520,PERIPHERAL_GESTURAL_INPUT : 0x0522, + IMAGING_UNCATEGORIZED : 0x0600,IMAGING_DISPLAY : 0x0610, + IMAGING_CAMERA : 0x0620,IMAGING_SCANNER : 0x0640, + IMAGING_PRINTER : 0x0680,WEARABLE_UNCATEGORIZED : 0x0700, + WEARABLE_WRIST_WATCH : 0x0704,WEARABLE_PAGER : 0x0708, + WEARABLE_JACKET : 0x070C,WEARABLE_HELMET : 0x0710, + WEARABLE_GLASSES : 0x0714,TOY_UNCATEGORIZED : 0x0800, + TOY_ROBOT : 0x0804,TOY_VEHICLE : 0x0808, + TOY_DOLL_ACTION_FIGURE : 0x080C,TOY_CONTROLLER : 0x0810, + TOY_GAME : 0x0814,HEALTH_UNCATEGORIZED : 0x0900, + HEALTH_BLOOD_PRESSURE : 0x0904,HEALTH_THERMOMETER : 0x0908, + HEALTH_WEIGHING : 0x090C,HEALTH_GLUCOSE : 0x0910, + HEALTH_PULSE_OXIMETER : 0x0914,HEALTH_PULSE_RATE : 0x0918, + HEALTH_DATA_DISPLAY : 0x091C,HEALTH_STEP_COUNTER : 0x0920, + HEALTH_BODY_COMPOSITION_ANALYZER : 0x0924, + HEALTH_PEAK_FLOW_MOITOR : 0x0928,HEALTH_MEDICATION_MONITOR : 0x092C, + HEALTH_KNEE_PROSTHESIS : 0x0930,HEALTH_ANKLE_PROSTHESIS : 0x0934, + HEALTH_GENERIC_HEALTH_MANAGER : 0x0938, + HEALTH_PERSONAL_MOBILITY_DEVICE : 0x093C, + HEALTH_PERSONAL_MOBILITY_DEVICE : 0x093C +}; +let MajorClass = { + MAJOR_MISC : 0x0000,MAJOR_COMPUTER : 0x0100, + MAJOR_PHONE : 0x0200,MAJOR_NETWORKING : 0x0300, + MAJOR_AUDIO_VIDEO: 0x0400,MAJOR_PERIPHERAL : 0x0500, + MAJOR_IMAGING : 0x0600,MAJOR_WEARABLE : 0x0700, + MAJOR_TOY : 0x0800,MAJOR_HEALTH : 0x0900, + MAJOR_UNCATEGORIZED : 0x1F00 +}; + +let ProfileId = { + PROFILE_A2DP_SOURCE: 1, + PROFILE_HANDS_FREE_AUDIO_GATEWAY: 4, + PROFILE_HID_HOST: 6, + PROFILE_PAN_NETWORK: 7 +}; + export default function bluetoothBLETest1() { describe('bluetoothBLETest1', function() { @@ -31,7 +111,7 @@ describe('bluetoothBLETest1', function() { case 0: console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); break; case 1: console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta)); @@ -43,12 +123,38 @@ describe('bluetoothBLETest1', function() { case 3: console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); break; default: console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(async function (done) { console.info('beforeAll called') await tryToEnableBt() diff --git a/communication/bluetooth_manager/src/main/js/test/SwitchOff003.test.js b/communication/bluetooth_manager/src/main/js/test/SwitchOff003.test.js index 6b4f16aa757c8f743b075da357f3bf0aa594348c..0bb3bdf7ab93824349cb835495cca64fd872d040 100644 --- a/communication/bluetooth_manager/src/main/js/test/SwitchOff003.test.js +++ b/communication/bluetooth_manager/src/main/js/test/SwitchOff003.test.js @@ -14,6 +14,11 @@ */ import bluetooth from '@ohos.bluetoothManager'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' export default function bluetoothBLETest3() { @@ -46,6 +51,32 @@ describe('bluetoothBLETest3', function() { console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') gattServer = bluetooth.BLE.createGattServer(); @@ -198,12 +229,12 @@ describe('bluetoothBLETest3', function() { */ it('COMMUNICATION_BLUETOOTH_SwitchOff_0600', 0, async function (done) { try { - let a2dpSrcConn = bluetooth.getProfileConnState(bluetooth.ProfileId.PROFILE_A2DP_SOURCE); + let a2dpSrcConn = bluetooth.getProfileConnectionState(bluetooth.ProfileId.PROFILE_A2DP_SOURCE); console.info('[bluetooth_js]get a2dp result:' + JSON.stringify(a2dpSrcConn)); expect(true).assertFalse(); done() } catch (error) { - console.error('[bluetooth_js]getProfileConnState error.code:'+JSON.stringify(error.code)+ + console.error('[bluetooth_js]getProfileConnectionState error.code:'+JSON.stringify(error.code)+ 'error.message:'+JSON.stringify(error.message)); expect(error.code).assertEqual('2900003'); done() @@ -355,7 +386,7 @@ describe('bluetoothBLETest3', function() { */ it('COMMUNICATION_BLUETOOTH_SwitchOff_1600', 0, async function (done) { try { - let hfpSrc = bluetooth.getProfileInst(bluetooth.ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY); + let hfpSrc = bluetooth.getProfileInstance(bluetooth.ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY); let retArray = hfpSrc.getConnectionDevices(); console.info('[bluetooth_js]hfp getConnectionDevices:' + JSON.stringify(retArray)); expect(true).assertFalse(); @@ -571,7 +602,7 @@ describe('bluetoothBLETest3', function() { */ it('COMMUNICATION_BLUETOOTH_SwitchOff_2500', 0, async function (done) { try { - let panSrc = + let panSrc = bluetooth.getProfileInst(bluetooth.ProfileId.PROFILE_PAN_NETWORK); panSrc.disconnect('11:22:33:44:55:77'); expect(true).assertFalse(); @@ -595,7 +626,7 @@ describe('bluetoothBLETest3', function() { */ it('COMMUNICATION_BLUETOOTH_SwitchOff_2600', 0, async function (done) { try { - let panSrc = + let panSrc = bluetooth.getProfileInst(bluetooth.ProfileId.PROFILE_PAN_NETWORK); panSrc.setTethering(true); expect(true).assertFalse(); @@ -957,7 +988,7 @@ describe('bluetoothBLETest3', function() { * @tc.level Level 2 */ it('COMMUNICATION_BLUETOOTH_SwitchOff_4000', 0, async function (done) { - + try { bluetooth.cancelPairedDevice("11:22:55:66:33:44"); expect(true).assertFalse(); @@ -967,7 +998,7 @@ describe('bluetoothBLETest3', function() { 'error.message:'+JSON.stringify(error.message)); expect(error.code).assertEqual('2900003'); done() - } + } }) }) diff --git a/communication/bluetooth_on/src/main/js/test/BleScanResult.test.js b/communication/bluetooth_on/src/main/js/test/BleScanResult.test.js index 11ec404d23b084b966f4f8a3da25f32804d55e8c..b96f3a1b4cac34c350b489692caf851baee7b501 100644 --- a/communication/bluetooth_on/src/main/js/test/BleScanResult.test.js +++ b/communication/bluetooth_on/src/main/js/test/BleScanResult.test.js @@ -14,6 +14,11 @@ */ import bluetooth from '@ohos.bluetooth'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' export default function bluetoothhostTest() { @@ -27,7 +32,7 @@ describe('bluetoothhostTest', function() { switch(sta){ case 0: bluetooth.enableBluetooth(); - await sleep(5000); + await sleep(10000); let sta1 = bluetooth.getState(); console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta1)); break; @@ -40,7 +45,7 @@ describe('bluetoothhostTest', function() { break; case 3: bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); let sta2 = bluetooth.getState(); console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta2)); break; @@ -48,6 +53,32 @@ describe('bluetoothhostTest', function() { console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') }) diff --git a/communication/bluetooth_on/src/main/js/test/BluetoothPair.test.js b/communication/bluetooth_on/src/main/js/test/BluetoothPair.test.js index 0af005c4d0636c400480a70b1b1405a7ea9e3bfb..21d80d82ad6c31da7ad6bd6a194db6b05ab302ed 100644 --- a/communication/bluetooth_on/src/main/js/test/BluetoothPair.test.js +++ b/communication/bluetooth_on/src/main/js/test/BluetoothPair.test.js @@ -14,6 +14,11 @@ */ import bluetooth from '@ohos.bluetooth'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' @@ -28,7 +33,7 @@ describe('bluetoothhostTest2', function() { switch(sta){ case 0: bluetooth.enableBluetooth(); - await sleep(5000); + await sleep(10000); let sta1 = bluetooth.getState(); console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta1)); break; @@ -41,7 +46,7 @@ describe('bluetoothhostTest2', function() { break; case 3: bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); let sta2 = bluetooth.getState(); console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta2)); break; @@ -49,6 +54,32 @@ describe('bluetoothhostTest2', function() { console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') }) diff --git a/communication/bluetooth_on/src/main/js/test/bluetoothSys.test.js b/communication/bluetooth_on/src/main/js/test/bluetoothSys.test.js index 49d8f375290b02a1a7a3b4ceb9d9373ccec59076..b32d06376e8bf2bb2af04f0807547e48ea2baa87 100644 --- a/communication/bluetooth_on/src/main/js/test/bluetoothSys.test.js +++ b/communication/bluetooth_on/src/main/js/test/bluetoothSys.test.js @@ -15,6 +15,11 @@ import bluetooth from '@ohos.bluetooth'; import bluetoothsys from '@system.bluetooth'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' export default function bluetoothhostTest4() { @@ -28,7 +33,7 @@ describe('bluetoothhostTest4', function() { switch(sta){ case 0: bluetooth.enableBluetooth(); - await sleep(5000); + await sleep(10000); let sta1 = bluetooth.getState(); console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta1)); break; @@ -41,7 +46,7 @@ describe('bluetoothhostTest4', function() { break; case 3: bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); let sta2 = bluetooth.getState(); console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta2)); break; @@ -49,6 +54,32 @@ describe('bluetoothhostTest4', function() { console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') }) diff --git a/communication/bluetooth_profile/src/main/js/test/BluetoothA2dp.test.js b/communication/bluetooth_profile/src/main/js/test/BluetoothA2dp.test.js index c4b8f2e62203cb0c507de07d7b341dfe86b3ccac..84ece3d748fba764dc9051aaebab8dcc07886e56 100644 --- a/communication/bluetooth_profile/src/main/js/test/BluetoothA2dp.test.js +++ b/communication/bluetooth_profile/src/main/js/test/BluetoothA2dp.test.js @@ -14,8 +14,19 @@ */ import bluetooth from '@ohos.bluetooth'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' +let ProfileId = { + PROFILE_A2DP_SOURCE: 1, + PROFILE_HANDS_FREE_AUDIO_GATEWAY: 4, + PROFILE_HID_HOST: 6, + PROFILE_PAN_NETWORK: 7 +}; export default function bluetoothhostTest_host_1() { describe('bluetoothhostTest_host_1', function () { @@ -28,7 +39,7 @@ describe('bluetoothhostTest_host_1', function () { switch(sta){ case 0: bluetooth.enableBluetooth(); - await sleep(5000); + await sleep(10000); let sta1 = bluetooth.getState(); console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta1)); break; @@ -41,7 +52,7 @@ describe('bluetoothhostTest_host_1', function () { break; case 3: bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); let sta2 = bluetooth.getState(); console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta2)); break; @@ -49,6 +60,32 @@ describe('bluetoothhostTest_host_1', function () { console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') }) diff --git a/communication/bluetooth_profile/src/main/js/test/BluetoothHfp.test.js b/communication/bluetooth_profile/src/main/js/test/BluetoothHfp.test.js index 9a143b55b11af6e26cda2ca5e12c6fa65fe97b53..a299ea9a7eb6a70a4aaf1ce8602d0d085b8d9593 100644 --- a/communication/bluetooth_profile/src/main/js/test/BluetoothHfp.test.js +++ b/communication/bluetooth_profile/src/main/js/test/BluetoothHfp.test.js @@ -14,6 +14,11 @@ */ import bluetooth from '@ohos.bluetooth'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' @@ -28,7 +33,7 @@ describe('bluetoothhostTest_host_3', function () { switch(sta){ case 0: bluetooth.enableBluetooth(); - await sleep(5000); + await sleep(10000); let sta1 = bluetooth.getState(); console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta1)); break; @@ -41,7 +46,7 @@ describe('bluetoothhostTest_host_3', function () { break; case 3: bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); let sta2 = bluetooth.getState(); console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta2)); break; @@ -49,6 +54,32 @@ describe('bluetoothhostTest_host_3', function () { console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') }) diff --git a/communication/bluetooth_standard/src/main/js/test/BRDiscovery.test.js b/communication/bluetooth_standard/src/main/js/test/BRDiscovery.test.js index 16f8ea8311584ec4ebfdced79b89479b1706821e..b7bbf20b322d924bb068b07b9e22bb8647695e69 100644 --- a/communication/bluetooth_standard/src/main/js/test/BRDiscovery.test.js +++ b/communication/bluetooth_standard/src/main/js/test/BRDiscovery.test.js @@ -14,6 +14,9 @@ */ import bluetooth from '@ohos.bluetooth'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import osaccount from '@ohos.account.osAccount'; import abilityAccessCtrl from '@ohos.abilityAccessCtrl' import bundle from '@ohos.bundle' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' @@ -45,7 +48,7 @@ describe('bluetoothhostTest3', function() { switch(sta){ case 0: bluetooth.enableBluetooth(); - await sleep(5000); + await sleep(10000); let sta1 = bluetooth.getState(); console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta1)); break; @@ -58,7 +61,7 @@ describe('bluetoothhostTest3', function() { break; case 3: bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); let sta2 = bluetooth.getState(); console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta2)); break; @@ -66,6 +69,32 @@ describe('bluetoothhostTest3', function() { console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(async function (done) { console.info('beforeAll called') diff --git a/communication/bluetooth_standard/src/main/js/test/BRScanMode.test.js b/communication/bluetooth_standard/src/main/js/test/BRScanMode.test.js index 865597e37e982b3e20d5169d4c081cc0c35a12bd..432d8a1636fa8981e715ab865858154763f6c612 100644 --- a/communication/bluetooth_standard/src/main/js/test/BRScanMode.test.js +++ b/communication/bluetooth_standard/src/main/js/test/BRScanMode.test.js @@ -14,6 +14,11 @@ */ import bluetooth from '@ohos.bluetooth'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' export default function bluetoothhostTest2() { @@ -26,7 +31,7 @@ describe('bluetoothhostTest2', function() { switch(sta){ case 0: bluetooth.enableBluetooth(); - await sleep(5000); + await sleep(10000); let sta1 = bluetooth.getState(); console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta1)); break; @@ -39,7 +44,7 @@ describe('bluetoothhostTest2', function() { break; case 3: bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); let sta2 = bluetooth.getState(); console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta2)); break; @@ -47,6 +52,32 @@ describe('bluetoothhostTest2', function() { console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') }) diff --git a/communication/bluetooth_standard/src/main/js/test/BRSetLocalName.test.js b/communication/bluetooth_standard/src/main/js/test/BRSetLocalName.test.js index 1aebc38ba900d07d67bdfacc4eef182e1c4ebfeb..ab90a5d1d64a5f80224cf8492def558e0608fe77 100644 --- a/communication/bluetooth_standard/src/main/js/test/BRSetLocalName.test.js +++ b/communication/bluetooth_standard/src/main/js/test/BRSetLocalName.test.js @@ -14,6 +14,11 @@ */ import bluetooth from '@ohos.bluetooth'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' let Btname = { NUM_TEST :'012345678901234567890123456789012345678901234567890123'+ @@ -49,7 +54,7 @@ describe('bluetoothhostTest1', function() { switch(sta){ case 0: bluetooth.enableBluetooth(); - await sleep(5000); + await sleep(10000); let sta1 = bluetooth.getState(); console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta1)); break; @@ -62,7 +67,7 @@ describe('bluetoothhostTest1', function() { break; case 3: bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); let sta2 = bluetooth.getState(); console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta2)); break; @@ -70,6 +75,32 @@ describe('bluetoothhostTest1', function() { console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') }) diff --git a/communication/bluetooth_standard/src/main/js/test/BRSpp.test.js b/communication/bluetooth_standard/src/main/js/test/BRSpp.test.js index a9b1974e9517cb326237567dd1cb354e387b46bf..940fff3630f9d0e08e0e21958cc53e9cf70c1189 100644 --- a/communication/bluetooth_standard/src/main/js/test/BRSpp.test.js +++ b/communication/bluetooth_standard/src/main/js/test/BRSpp.test.js @@ -14,6 +14,11 @@ */ import bluetooth from '@ohos.bluetooth'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' @@ -29,7 +34,7 @@ describe('bluetoothhostTest4', function() { case 0: console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); break; case 1: console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta)); @@ -41,12 +46,38 @@ describe('bluetoothhostTest4', function() { case 3: console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); break; default: console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') }) diff --git a/communication/bluetooth_standard/src/main/js/test/BRSwitch.test.js b/communication/bluetooth_standard/src/main/js/test/BRSwitch.test.js index e5566ea1087a5670588aaf4947d62c06291e4079..1bb1fbbac283fb5a0308294d7a71873b7d35721d 100644 --- a/communication/bluetooth_standard/src/main/js/test/BRSwitch.test.js +++ b/communication/bluetooth_standard/src/main/js/test/BRSwitch.test.js @@ -14,8 +14,20 @@ */ import bluetooth from '@ohos.bluetooth'; +import geolocation from '@ohos.geolocation'; +import geolocationm from '@ohos.geoLocationManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import bundle from '@ohos.bundle'; +import osaccount from '@ohos.account.osAccount'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' - + +let BluetoothState = { + STATE_OFF: 0,STATE_TURNING_ON: 1, + STATE_ON: 2,STATE_TURNING_OFF: 3, + STATE_BLE_TURNING_ON: 4, STATE_BLE_ON: 5, + STATE_BLE_ON: 6 +}; + export default function bluetoothhostTest() { describe('bluetoothhostTest', function() { function sleep(delay) { @@ -26,7 +38,7 @@ describe('bluetoothhostTest', function() { switch(sta){ case 0: bluetooth.enableBluetooth(); - await sleep(5000); + await sleep(10000); let sta1 = bluetooth.getState(); console.info('[bluetooth_js] Reacquire bt state:'+ JSON.stringify(sta1)); break; @@ -39,7 +51,7 @@ describe('bluetoothhostTest', function() { break; case 3: bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); let sta2 = bluetooth.getState(); console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta2)); break; @@ -47,6 +59,32 @@ describe('bluetoothhostTest', function() { console.info('[bluetooth_js] enable success'); } } + async function applyPermission() { + let osAccountManager = osaccount.getAccountManager(); + console.info("=== getAccountManager finish"); + let localId = await osAccountManager.getOsAccountLocalIdFromProcess(); + console.info("LocalId is :" + localId); + let appInfo = await bundle.getApplicationInfo('ohos.acts.location.geolocation.function', 0, localId); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.LOCATION'; + let permissionName2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result)); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + JSON.stringify(err)); + }); + } else { + console.info('[permission] case apply permission failed, createAtManager failed'); + } + } beforeAll(function () { console.info('beforeAll called') }) @@ -81,7 +119,7 @@ describe('bluetoothhostTest', function() { if(state!=bluetooth.BluetoothState.STATE_ON) { let enable = bluetooth.enableBluetooth(); - await sleep(5000); + await sleep(10000); console.info('[bluetooth_js] bluetooth enable001'+JSON.stringify(enable)); expect(enable).assertTrue(); let state1 = bluetooth.getState(); @@ -109,12 +147,13 @@ describe('bluetoothhostTest', function() { * @tc.level Level 3 */ it('SUB_COMMUNICATION_BLUETOOTH_BR_Switch_0300', 0, async function (done) { + let enable = bluetooth.enableBluetooth(); let state = bluetooth.getState(); console.info('[bluetooth_js] bt open state1 = '+ JSON.stringify(state)); expect(state).assertEqual(bluetooth.BluetoothState.STATE_ON); if(state==bluetooth.BluetoothState.STATE_ON) { let enable1=bluetooth.enableBluetooth(); - await sleep(3000); + await sleep(10000); console.info('[bluetooth_js]enable1 :'+ JSON.stringify(enable1)); expect(enable1).assertFalse(); let state1 = bluetooth.getState(); diff --git a/demo/sectest/static_patch_scan/2022-09/OpenHarmony-SA-2022-0905.yara b/demo/sectest/static_patch_scan/2022-09/OpenHarmony-SA-2022-0905.yara new file mode 100644 index 0000000000000000000000000000000000000000..18e9b62cd13b5160d156b34e4451934488402be2 --- /dev/null +++ b/demo/sectest/static_patch_scan/2022-09/OpenHarmony-SA-2022-0905.yara @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import "console" +import "elf" + +rule OpenHarmony_SA_2022_0905 +{ + meta: + date="2023-03-08" + openharmony_sa="OpenHarmony-SA-2022-0905" + affected_files="libcamera_service.z.so" + + strings: + $fix = "HCameraService::CreateCameraDevice: Permission to Access Camera Granted!!!!" + + condition: + $fix and console.log("OpenHarmony-SA-2022-0905 testcase pass") + } + \ No newline at end of file diff --git a/distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunit.test.js b/distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunit.test.js index b47b63c12674e27ad2acad620c2bf74940e3c8a8..a521e10544b45582d2a406c37de15d3e586718c5 100644 --- a/distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunit.test.js +++ b/distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunit.test.js @@ -18,7 +18,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl' import bundle from '@ohos.bundle' var baseLine = 3000; //3 second -var gObject; +const CATCH_ERR = -1; const TAG = "OBJECTSTORE_TEST"; function changeCallback(sessionId, changeData) { @@ -699,18 +699,18 @@ export default function objectStoreTest() { expect(complexObject.list[0].mother == "jack2 mom2").assertEqual(true); expect(complexObject.list[1].father == "jack2 Dad2").assertEqual(true); - console.log(TAG + "start unWatch change"); + console.info(TAG + "start unWatch change"); complexObject.off("change"); - console.log(TAG + "end unWatch success"); + console.info(TAG + "end unWatch success"); } var endTime = new Date().getTime(); var totalTime = endTime - startTime; - console.log("testPerformance001 totalTime = " + totalTime); - console.log("testPerformance001 baseLine = " + baseLine); + console.info("testPerformance001 totalTime = " + totalTime); + console.info("testPerformance001 baseLine = " + baseLine); expect(totalTime < baseLine).assertEqual(true); complexObject.setSessionId(""); done(); - console.log(TAG + "************* testPerformance001 end *************"); + console.info(TAG + "************* testPerformance001 end *************"); }) /** @@ -720,26 +720,32 @@ export default function objectStoreTest() { */ it('testSave001', 0, async function (done) { console.info(TAG + "************* testSave001 start *************"); - - var gObject = distributedObject.createDistributedObject({ name: "Amy", age: 18, isVis: false }); - gObject.setSessionId("tmpsession01"); - let result = await gObject.save("local"); - done(); - expect(result.sessionId == "tmpsession01").assertEqual(true); - expect(result.version == gObject.__version).assertEqual(true); - expect(result.deviceId == "local").assertEqual(true); - - gObject.setSessionId(""); - gObject.name = undefined; - gObject.age = undefined; - gObject.isVis = undefined; - - gObject.setSessionId("tmpsession01"); - expect(gObject.name == "Amy").assertEqual(true); - expect(gObject.age == 18).assertEqual(true); - expect(gObject.isVis == false).assertEqual(true); - gObject.setSessionId(""); - done(); + var g_object = distributedObject.createDistributedObject({ name: "Amy", age: 18, isVis: false }); + expect(g_object == undefined).assertEqual(false); + + g_object.setSessionId("testSession001"); + expect("testSession001" == g_object.__sessionId).assertEqual(true); + + g_object.save("local").then((ret) => { + expect(ret.sessionId == "testSession001").assertEqual(true); + expect(ret.version == g_object.__version).assertEqual(true); + expect(ret.deviceId == "local").assertEqual(true); + done(); + + g_object.setSessionId(""); + g_object.name = undefined; + g_object.age = undefined; + g_object.isVis = undefined; + g_object.setSessionId("testSession001"); + + expect(g_object.name == "Amy").assertEqual(true); + expect(g_object.age == 18).assertEqual(true); + expect(g_object.isVis == false).assertEqual(true); + }).catch((err) => { + console.info('testSave001 err ' + `, error code is ${err.code}, message is ${err.message}`); + expect("801").assertEqual(err.code.toString()); + done(); + }); console.info(TAG + "************* testSave001 end *************"); }) @@ -748,67 +754,81 @@ export default function objectStoreTest() { * @tc.desc: Save object * @tc.number: SUB_DDM_AppDataFWK_Object_Api_Save_002 */ - it('testSave002', 0, function (done) { + it('testSave002', 0, async function (done) { console.info(TAG + "************* testSave002 start *************"); - var gObject = distributedObject.createDistributedObject({ name: "Amy", age: 18, isVis: false }); - if (gObject != undefined && gObject != null) { - gObject.setSessionId("tmpsession02"); - console.info(TAG + "testSave002 joinSession tmpsession02 success:"+ gObject.__sessionId); - } - gObject.save("local", (result) => { - console.info("save callback"); - expect(result.sessionId == "tmpsession02").assertEqual(true); - expect(result.version == gObject.__version).assertEqual(true); + var g_object = distributedObject.createDistributedObject({ name: "Amy", age: 18, isVis: false }); + expect(g_object == undefined).assertEqual(false); + + g_object.setSessionId("testSession002"); + expect("testSession002" == g_object.__sessionId).assertEqual(true); + + g_object.save("local", (err, result) => { + if (err) { + console.info('testSave002 err ' + `, error code is ${err.code}, message is ${err.message}`); + expect("801").assertEqual(err.code.toString()); + done(); + return; + } + expect(result.sessionId == "testSession002").assertEqual(true); + expect(result.version == g_object.__version).assertEqual(true); expect(result.deviceId == "local").assertEqual(true); - console.info("save end"); - console.info("save success"); - gObject.setSessionId(""); - gObject.name = undefined; - gObject.age = undefined; - gObject.isVis = undefined; - - console.info("save setSessionId"); - gObject.setSessionId("tmpsession02"); - expect(gObject.name == "Amy").assertEqual(true); - expect(gObject.age == 18).assertEqual(true); - expect(gObject.isVis == false).assertEqual(true); + done(); - gObject.setSessionId(""); - - }); - done(); + g_object.setSessionId(""); + g_object.name = undefined; + g_object.age = undefined; + g_object.isVis = undefined; + g_object.setSessionId("testSession002"); + + expect(g_object.name == "Amy").assertEqual(true); + expect(g_object.age == 18).assertEqual(true); + expect(g_object.isVis == false).assertEqual(true); + }) console.info(TAG + "************* testSave002 end *************"); }) - /** * @tc.name: testRevokeSave001 * @tc.desc: Revoke save object * @tc.number: SUB_DDM_AppDataFWK_Object_Api_RevokeSave_001 */ - it('testRevokeSave001', 0, async function (done) { + it('testRevokeSave001', 0, async function (done) { console.info(TAG + "************* testRevokeSave001 start *************"); - var RObject = distributedObject.createDistributedObject({ name: "Amy", age: 18, isVis: false }); - RObject.setSessionId("tmpsession03"); - expect("tmpsession03" == RObject.__sessionId).assertEqual(true); - let result = await RObject.save("local"); - done(); - expect(result.sessionId == "tmpsession03").assertEqual(true); - expect(result.version == RObject.__version).assertEqual(true); - expect(result.deviceId == "local").assertEqual(true); - - result = await RObject.revokeSave(); - - RObject.setSessionId(""); - RObject.name = undefined; - RObject.age = undefined; - RObject.isVis = undefined; - - RObject.setSessionId("tmpsession03"); - expect(RObject.name == "Amy").assertEqual(false); - expect(RObject.age == 18).assertEqual(false); - expect(RObject.isVis == false).assertEqual(false); - RObject.setSessionId(""); - done(); + var g_object = distributedObject.createDistributedObject({ name: "Amy", age: 18, isVis: false }); + expect(g_object == undefined).assertEqual(false); + + g_object.setSessionId("testSession003"); + expect("testSession003" == g_object.__sessionId).assertEqual(true); + + g_object.save("local", (err, result) => { + if (err) { + console.info('testRevokeSave001 err ' + `, error code is ${err.code}, message is ${err.message}`); + expect("801").assertEqual(err.code.toString()); + done(); + return; + } + expect(result.sessionId == "testSession003").assertEqual(true); + expect(result.version == g_object.__version).assertEqual(true); + expect(result.deviceId == "local").assertEqual(true); + g_object.revokeSave((err, result) => { + if (err) { + expect("801").assertEqual(err.code.toString()); + done(); + return; + } + expect("testSession003" == result.sessionId).assertEqual(true); + g_object.setSessionId(""); + g_object.name = undefined; + g_object.age = undefined; + g_object.isVis = undefined; + g_object.setSessionId("testSession003"); + + expect(g_object.name == undefined).assertEqual(true); + expect(g_object.age == undefined).assertEqual(true); + expect(g_object.isVis == undefined).assertEqual(true); + done(); + }) + }); + console.info(TAG + "************* testRevokeSave001 end *************"); }) @@ -817,31 +837,49 @@ export default function objectStoreTest() { * @tc.desc: Revoke save object * @tc.number: SUB_DDM_AppDataFWK_Object_Api_RevokeSave_002 */ - it('testRevokeSave002', 0, async function (done) { + it('testRevokeSave002', 0, async function () { console.info(TAG + "************* testRevokeSave002 start *************"); - var RObject = distributedObject.createDistributedObject({ name: "Amy", age: 18, isVis: false }); - RObject.setSessionId("tmpsession04"); - expect("tmpsession04" == RObject.__sessionId).assertEqual(true); - let result = await RObject.save("local"); - done(); - RObject.revokeSave((response)=>{ - console.info(TAG +"revokeSave callback"); - console.info("revokeSave sessionId: " + response.sessionId); - console.info(TAG +"revokeSave end"); - RObject.setSessionId(""); - RObject.name = undefined; - RObject.age = undefined; - RObject.isVis = undefined; - - RObject.setSessionId("tmpsession04"); - expect(RObject.name == "Amy").assertEqual(false); - expect(RObject.age == 18).assertEqual(false); - expect(RObject.isVis == false).assertEqual(false); - RObject.setSessionId(""); + var g_object = distributedObject.createDistributedObject({ name: "Amy", age: 18, isVis: false }); + expect(g_object == undefined).assertEqual(false); + + g_object.setSessionId("testSession004"); + expect("testSession004" == g_object.__sessionId).assertEqual(true); + + let result = await g_object.save("local").catch((err)=> { + expect("801").assertEqual(err.code.toString()); + return CATCH_ERR; }); - done(); + if (result === CATCH_ERR) { + return; + } + + expect(result.sessionId.toString() == "testSession004").assertEqual(true); + expect(result.version.toString() == g_object.__version.toString()).assertEqual(true); + expect(result.deviceId.toString() == "local").assertEqual(true); + + result = await g_object.revokeSave().catch((err) => { + console.info('testRevokeSave002 err ' + `, error code is ${err.code}, message is ${err.message}`); + expect("801").assertEqual(err.code.toString()); + return CATCH_ERR; + }); + + if (result === CATCH_ERR) { + return; + } + g_object.setSessionId(""); + g_object.name = undefined; + g_object.age = undefined; + g_object.isVis = undefined; + g_object.setSessionId("testSession004"); + + expect(g_object.name == undefined).assertEqual(true); + expect(g_object.age == undefined).assertEqual(true); + expect(g_object.isVis == undefined).assertEqual(true); + + console.info(TAG + "************* testRevokeSave002 end *************"); }) + console.info(TAG + "*************Unit Test End*************"); }) } \ No newline at end of file diff --git a/distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunitV9.test.js b/distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunitV9.test.js index 36e18189864d97291e204ce57f124e1a6dfa6efe..5787e21c3675c2f0a99bd2ecd8a1111f637aaeae 100644 --- a/distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunitV9.test.js +++ b/distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunitV9.test.js @@ -17,6 +17,7 @@ import distributedObject from '@ohos.data.distributedDataObject'; import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; import featureAbility from '@ohos.ability.featureAbility'; import bundle from '@ohos.bundle'; +const CATCH_ERR = -1; let context; const TAG = "OBJECTSTORE_TEST"; function changeCallback(sessionId, changeData) { @@ -74,7 +75,7 @@ describe('objectStoreTest', function () { console.info(TAG + 'afterAll') }) - console.log(TAG + "*************Unit Test Begin*************"); + console.info(TAG + "*************Unit Test Begin*************"); /** @@ -84,7 +85,7 @@ describe('objectStoreTest', function () { * @tc.type: FUNC */ it('SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001', 0, function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001 start *************"); var g_object; try { g_object = distributedObject.create(123, {name: "Amy", age: 18, isVis: false}); @@ -108,7 +109,7 @@ describe('objectStoreTest', function () { }).catch((error) => { console.info(TAG + error); }); - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001 end *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001 end *************"); g_object.setSessionId((error, data) => { console.info(TAG + error + "," + data); }); @@ -122,7 +123,7 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_002 */ it('SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_002', 0, function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_002 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_002 start *************"); var g_object = distributedObject.create(context, {name: "Amy", age: 18, isVis: false}); expect(g_object == undefined).assertEqual(false); try { @@ -136,7 +137,7 @@ describe('objectStoreTest', function () { expect(error.code == 401).assertEqual(true); expect(error.message == "Parameter error. The type of 'sessionId' must be 'string'.").assertEqual(true); } - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_002 end *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_002 end *************"); g_object.setSessionId((error, data) => { console.info(TAG + error + "," + data); }); @@ -150,7 +151,7 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_003 */ it('SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_003', 0, function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_003 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_003 start *************"); var g_object = distributedObject.create(context, {name: "Amy", age: 18, isVis: false}); expect(g_object == undefined).assertEqual(false); g_object.setSessionId("session1"); @@ -161,7 +162,7 @@ describe('objectStoreTest', function () { expect(error.code == 15400001).assertEqual(true); expect(error.message == "create table failed").assertEqual(true); }); - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_003 end *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_003 end *************"); g_object.setSessionId((error, data) => { console.info(TAG + error + "," + data); }); @@ -175,7 +176,7 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_004 */ it('SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_004', 0, function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_004 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_004 start *************"); var g_object = distributedObject.create(context, {name: "Amy", age: 18, isVis: false}); expect(g_object == undefined).assertEqual(false); g_object.setSessionId("123456").then((data) => { @@ -184,7 +185,7 @@ describe('objectStoreTest', function () { }).catch((err) => { console.info(TAG + err.code + err.message); }); - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_004 end *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_004 end *************"); g_object.setSessionId((error, data) => { console.info(TAG + error + "," + data); }); @@ -198,7 +199,7 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_005 */ it('SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_005', 0, function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_005 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_005 start *************"); var g_object = distributedObject.create(context, {name: "Amy", age: 18, isVis: false}); expect(g_object == undefined).assertEqual(false); g_object.setSessionId("123456", (error, data) => { @@ -214,11 +215,11 @@ describe('objectStoreTest', function () { console.info(TAG + "setSessionId test"); }); } catch (error) { - console.log(error.code + error.message); + console.info(error.code + error.message); expect(error.code == 401).assertEqual(true); expect(error.message == "Parameter error. The type of 'sessionId' must be 'string'.").assertEqual(true); } - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_005 end *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_005 end *************"); g_object.setSessionId("", (error, data) => { console.info(TAG + error + "," + data); }); @@ -233,7 +234,7 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_On_001 */ it('SUB_DDM_AppDataFWK_Object_Api9_On_001', 0, function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_On_001 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_On_001 start *************"); var g_object = distributedObject.create(context, {name: "Amy", age: 18, isVis: false}); expect(g_object == undefined).assertEqual(false); g_object.setSessionId("session1").then(() => { @@ -264,7 +265,7 @@ describe('objectStoreTest', function () { console.info(TAG + " object is null,set name fail"); } - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_On_001 end *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_On_001 end *************"); g_object.off("change"); g_object.setSessionId("", (error, data) => { console.info(TAG + error + "," + data); @@ -279,7 +280,7 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_On_002 */ it('SUB_DDM_AppDataFWK_Object_Api9_On_002', 0, function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_On_002 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_On_002 start *************"); var g_object = distributedObject.create(context, {name: "Amy", age: 18, isVis: false}); expect(g_object == undefined).assertEqual(false); g_object.setSessionId("session1"); @@ -301,7 +302,7 @@ describe('objectStoreTest', function () { expect(error.code == 401).assertEqual(true); expect(error.message == "Parameter error. The type of 'type' must be 'string'.").assertEqual(true); } - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_On_002 end *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_On_002 end *************"); g_object.setSessionId("", (error, data) => { console.info(TAG + error + "," + data); }); @@ -315,7 +316,7 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_On_003 */ it('SUB_DDM_AppDataFWK_Object_Api9_On_003', 0, function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_On_003 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_On_003 start *************"); var g_object = distributedObject.create(context, {name: "Amy", age: 18, isVis: false}); expect(g_object == undefined).assertEqual(false); g_object.setSessionId("session1").then(() => { @@ -338,7 +339,7 @@ describe('objectStoreTest', function () { } catch (error) { expect(error != undefined).assertEqual(true); } - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_On_003 end *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_On_003 end *************"); g_object.off("error"); g_object.setSessionId("", (error, data) => { console.info(TAG + error + "," + data); @@ -353,7 +354,7 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_Off_001 */ it('SUB_DDM_AppDataFWK_Object_Api9_Off_001', 0, function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Off_001 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Off_001 start *************"); var g_object = distributedObject.create(context, {name: "Amy", age: 18, isVis: false}); expect(g_object == undefined).assertEqual(false); g_object.setSessionId("session5").then(() => { @@ -387,7 +388,7 @@ describe('objectStoreTest', function () { } else { console.info(TAG + " object is null,set name fail"); } - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Off_001 end *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Off_001 end *************"); g_object.setSessionId((error, data) => { console.info(TAG + error + "," + data); }); @@ -401,7 +402,7 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_Off_002 */ it('SUB_DDM_AppDataFWK_Object_Api9_Off_002', 0, function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Off_002 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Off_002 start *************"); var g_object = distributedObject.create(context, {name: "Amy", age: 18, isVis: false}); expect(g_object == undefined).assertEqual(false); g_object.setSessionId("session6").then(() => { @@ -417,7 +418,7 @@ describe('objectStoreTest', function () { expect(error.message == "Parameter error. The type of 'type' must be 'string'.").assertEqual(true); } console.info(TAG + " end call watch change"); - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Off_002 end *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Off_002 end *************"); g_object.setSessionId().then((data) => { console.info(TAG + data); console.info(TAG + "setSessionId test"); @@ -434,8 +435,8 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_OnStatus_001 */ it('SUB_DDM_AppDataFWK_Object_Api9_OnStatus_001', 0, function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_OnStatus_001 start *************"); - console.log(TAG + "start watch status"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_OnStatus_001 start *************"); + console.info(TAG + "start watch status"); var g_object = distributedObject.create(context, {name: "Amy", age: 18, isVis: false}); expect(g_object == undefined).assertEqual(false); try { @@ -444,8 +445,8 @@ describe('objectStoreTest', function () { expect(error.code == 401).assertEqual(true); expect(error.message == "Parameter error. The type of 'callback' must be 'function'.").assertEqual(true); } - console.log(TAG + "watch success"); - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_OnStatus_001 end *************"); + console.info(TAG + "watch success"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_OnStatus_001 end *************"); g_object.setSessionId("").then((data) => { console.info(TAG + data); console.info(TAG + "setSessionId test"); @@ -462,17 +463,17 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_OnStatus_002 */ it('SUB_DDM_AppDataFWK_Object_Api9_OnStatus_002', 0, function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_OnStatus_002 start *************"); - console.log(TAG + "start watch status"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_OnStatus_002 start *************"); + console.info(TAG + "start watch status"); var g_object = distributedObject.create(context, {name: "Amy", age: 18, isVis: false}); expect(g_object == undefined).assertEqual(false); expect(g_object.name == "Amy").assertEqual(true); g_object.on("status", statusCallback1); - console.log(TAG + "watch success"); - console.log(TAG + "start call unwatch status"); + console.info(TAG + "watch success"); + console.info(TAG + "start call unwatch status"); g_object.off("status"); - console.log(TAG + "unwatch success"); - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_OnStatus_002 end *************"); + console.info(TAG + "unwatch success"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_OnStatus_002 end *************"); g_object.setSessionId().then(() => { console.info("leave session"); }).catch((error) => { @@ -488,46 +489,41 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_Save_001 */ it('SUB_DDM_AppDataFWK_Object_Api9_Save_001', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Save_001 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Save_001 start *************"); + console.info(TAG + "************* V9testSave001 start *************"); var g_object = distributedObject.create(context, {name: "Amy", age: 18, isVis: false}); expect(g_object == undefined).assertEqual(false); - g_object.setSessionId("tmpsession1").then(() => { + g_object.setSessionId("mySession1").then(() => { console.info("join session"); }).catch((error) => { console.info(TAG + error.code + error.message); }); - expect("tmpsession1" == g_object.__sessionId).assertEqual(true); + expect("mySession1" == g_object.__sessionId).assertEqual(true); - let result = await g_object.save("local"); - expect(result.sessionId == "tmpsession1").assertEqual(true); - expect(result.version == g_object.__version).assertEqual(true); - expect(result.deviceId == "local").assertEqual(true); + g_object.save("local").then((ret) => { + expect(ret.sessionId == "mySession1").assertEqual(true); + expect(ret.version == g_object.__version).assertEqual(true); + expect(ret.deviceId == "local").assertEqual(true); + done(); - g_object.setSessionId((error, data) => { - console.info(TAG + error + "," + data); - }); - g_object.name = undefined; - g_object.age = undefined; - g_object.isVis = undefined; - g_object.setSessionId("tmpsession1").then(() => { - console.info("join session"); - }).catch((error) => { - console.info(TAG + error.code + error.message); - }); + g_object.setSessionId(""); + g_object.name = undefined; + g_object.age = undefined; + g_object.isVis = undefined; + g_object.setSessionId("mySession1"); - expect(g_object.name == "Amy").assertEqual(true); - expect(g_object.age == 18).assertEqual(true); - expect(g_object.isVis == false).assertEqual(true); - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Save_001 end *************"); - g_object.setSessionId().then(() => { - console.info("leave session"); - }).catch((error) => { - console.info(TAG + error.code + error.message); + expect(g_object.name == "Amy").assertEqual(true); + expect(g_object.age == 18).assertEqual(true); + expect(g_object.isVis == false).assertEqual(true); + }).catch((err) => { + console.info('testV9Save001 err ' + `, error code is ${err.code}, message is ${err.message}`); + expect("801").assertEqual(err.code.toString()); + done(); }); - done(); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Save_001 end *************"); }) - + /** * @tc.name: V9testSave002 * @tc.desc: test save local @@ -535,47 +531,38 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_Save_002 */ it('SUB_DDM_AppDataFWK_Object_Api9_Save_002', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Save_002 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Save_002 start *************"); var g_object = distributedObject.create(context, {name: "Amy", age: 18, isVis: false}); expect(g_object == undefined).assertEqual(false); - g_object.setSessionId("tmpsession1").then(() => { - console.info("join session"); - }).catch((error) => { - console.info(TAG + error.code + error.message); - }); - expect("tmpsession1" == g_object.__sessionId).assertEqual(true); - try { - g_object.save(1234).then((result) => { - expect(result.sessionId == "tmpsession1").assertEqual(true); - expect(result.version == g_object.__version).assertEqual(true); - expect(result.deviceId == "local").assertEqual(true); - }) - } catch (error) { - expect(error.message == "Parameter error. The type of 'deviceId' must be 'string'.").assertEqual(true); - } - g_object.save("errorDeviceId").then((result) => { - expect(result.sessionId == "tmpsession1").assertEqual(true); + g_object.setSessionId("mySession2"); + expect("mySession2" == g_object.__sessionId).assertEqual(true); + + g_object.save("local", (err, result) => { + if (err) { + console.info('testV9Save002 err ' + `, error code is ${err.code}, message is ${err.message}`); + expect("801").assertEqual(err.code.toString()); + done(); + return; + } + expect(result.sessionId == "mySession2").assertEqual(true); expect(result.version == g_object.__version).assertEqual(true); expect(result.deviceId == "local").assertEqual(true); - }).catch((error) => { - expect(error != undefined).assertEqual(true); - }); - - try { - g_object.save("local", 123); - } catch (error) { - expect(error.code == 401).assertEqual(true); - expect(error.message == "Parameter error. The type of 'callback' must be 'function'.").assertEqual(true); - } - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Save_002 end *************"); - g_object.setSessionId().then(() => { - console.info("leave session"); - }).catch((error) => { - console.info(TAG + error.code + error.message); + + g_object.setSessionId(""); + g_object.name = undefined; + g_object.age = undefined; + g_object.isVis = undefined; + g_object.setSessionId("mySession2"); + + expect(g_object.name == "Amy").assertEqual(true); + expect(g_object.age == 18).assertEqual(true); + expect(g_object.isVis == false).assertEqual(true); + done(); }); - done(); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_Save_002 end *************"); }) + /** * @tc.name: V9testRevokeSave001 @@ -584,45 +571,46 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_001 */ it('SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_001', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_001 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_001 start *************"); var g_object = distributedObject.create(context, {name: "Amy", age: 18, isVis: false}); expect(g_object == undefined).assertEqual(false); - g_object.setSessionId("123456").then(() => { - console.info("join session"); - }).catch((error) => { - console.info(TAG + error.code + error.message); - }); - expect("123456" == g_object.__sessionId).assertEqual(true); + g_object.setSessionId("mySession4"); + expect("mySession4" == g_object.__sessionId).assertEqual(true); - let result = await g_object.save("local"); - expect(result.sessionId == "123456").assertEqual(true); - expect(result.version == g_object.__version).assertEqual(true); - expect(result.deviceId == "local").assertEqual(true); - result = await g_object.revokeSave(); - - g_object.setSessionId((error, data) => { - console.info(TAG + error + "," + data); - }); - g_object.name = undefined; - g_object.age = undefined; - g_object.isVis = undefined; - g_object.setSessionId("123456").then(() => { - console.info("join session"); - }).catch((error) => { - console.info(TAG + error.code + error.message); - }); - - expect(g_object.name == undefined).assertEqual(true); - expect(g_object.age == undefined).assertEqual(true); - expect(g_object.isVis == undefined).assertEqual(true); - expect(result.sessionId == "123456").assertEqual(true); - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_001 end *************"); - g_object.setSessionId("", (error, data) => { - console.info(TAG + error + "," + data); + g_object.save("local", (err, result) => { + if (err) { + console.info('testV9RevokeSave001 err ' + `, error code is ${err.code}, message is ${err.message}`); + expect("801").assertEqual(err.code.toString()); + done(); + return; + } + expect(result.sessionId == "mySession4").assertEqual(true); + expect(result.version == g_object.__version).assertEqual(true); + expect(result.deviceId == "local").assertEqual(true); + g_object.revokeSave((err, result) => { + if (err) { + expect("801").assertEqual(err.code.toString()); + done(); + return; + } + expect("mySession4" == result.sessionId).assertEqual(true); + g_object.setSessionId(""); + g_object.name = undefined; + g_object.age = undefined; + g_object.isVis = undefined; + g_object.setSessionId("mySession4"); + + expect(g_object.name == undefined).assertEqual(true); + expect(g_object.age == undefined).assertEqual(true); + expect(g_object.isVis == undefined).assertEqual(true); + done(); + }) }); - done(); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_001 end *************"); }) + + /** * @tc.name: V9testRevokeSave002 @@ -630,37 +618,48 @@ describe('objectStoreTest', function () { * @tc.type: FUNC * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_002 */ - it('SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_002', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_002 start *************"); + it('SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_002', 0, async function () { + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_002 start *************"); var g_object = distributedObject.create(context, {name: "Amy", age: 18, isVis: false}); - expect(g_object == undefined).assertEqual(false); - g_object.setSessionId("123456").then(() => { - console.info("join session"); - }).catch((error) => { - console.info(TAG + error.code + error.message); + expect(g_object != undefined).assertEqual(true); + + g_object.setSessionId("mySession5"); + expect("mySession5" == g_object.__sessionId.toString()).assertEqual(true); + + let result = await g_object.save("local").catch((err) => { + console.info('testV9Save001 err ' + `, error code is ${err.code}, message is ${err.message}`); + expect("801").assertEqual(err.code.toString()); + return CATCH_ERR; }); - expect("123456" == g_object.__sessionId).assertEqual(true); - let result = await g_object.save("local"); - expect(result.sessionId == "123456").assertEqual(true); - expect(result.version == g_object.__version).assertEqual(true); - expect(result.deviceId == "local").assertEqual(true); - try { - g_object.revokeSave(123).then((result) => { - expect(result.sessionId == "tmpsession1").assertEqual(true) - }).catch((err) => { - console.log(err.code + err.message); - }); - } catch (error) { - console.info(error.code + error.message); - expect(error.code == 401).assertEqual(true); - expect(error.message == "Parameter error. The type of 'callback' must be 'function'.").assertEqual(true); + if (result === CATCH_ERR) { + return; } - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_002 end *************"); - g_object.setSessionId("", (error, data) => { - console.info(TAG + error + "," + data); + + expect(result.sessionId.toString() == "mySession5").assertEqual(true); + expect(result.version.toString() == g_object.__version.toString()).assertEqual(true); + expect(result.deviceId.toString() == "local").assertEqual(true); + + result = await g_object.revokeSave().catch((err)=> { + expect("801").assertEqual(err.code.toString()); + return CATCH_ERR; }); - done(); - }) + + if (result === CATCH_ERR) { + return; + } + g_object.setSessionId(""); + g_object.name = undefined; + g_object.age = undefined; + g_object.isVis = undefined; + g_object.setSessionId("mySession5"); + + expect(g_object.name == undefined).assertEqual(true); + expect(g_object.age == undefined).assertEqual(true); + expect(g_object.isVis == undefined).assertEqual(true); + + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_RevokeSave_002 end *************"); + }) + /** * @tc.name: testNumberMax * @tc.desc: test NumberMax @@ -668,7 +667,7 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_NumberMax_0100 */ it('SUB_DDM_AppDataFWK_Object_Api9_NumberMax_0100', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberMax_0100 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberMax_0100 start *************"); try { let g_object; let maxValue = Number.MAX_VALUE; @@ -678,7 +677,7 @@ describe('objectStoreTest', function () { } catch (error) { console.info(error.code + error.message); } - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberMax_0100 end *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberMax_0100 end *************"); done(); }) /** @@ -688,7 +687,7 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_NumberMin_0100 */ it('SUB_DDM_AppDataFWK_Object_Api9_NumberMin_0100', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberMin_0100 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberMin_0100 start *************"); try { let g_object; let minValue = Number.MIN_VALUE; @@ -698,7 +697,7 @@ describe('objectStoreTest', function () { } catch (error) { console.info(error.code + error.message); } - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberMin_0100 end *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberMin_0100 end *************"); done(); }) /** @@ -708,7 +707,7 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_NumberAbnormal_0100 */ it('SUB_DDM_AppDataFWK_Object_Api9_NumberAbnormal_0100', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberAbnormal_0100 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberAbnormal_0100 start *************"); try { let g_object; let abnValue = -1; @@ -718,7 +717,7 @@ describe('objectStoreTest', function () { } catch (error) { console.info(error.code + error.message); } - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberAbnormal_0100 end *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberAbnormal_0100 end *************"); done(); }) /** @@ -728,7 +727,7 @@ describe('objectStoreTest', function () { * @tc.number: SUB_DDM_AppDataFWK_Object_Api9_NumberAbnormal_0200 */ it('SUB_DDM_AppDataFWK_Object_Api9_NumberAbnormal_0100', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberAbnormal_0100 start *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberAbnormal_0100 start *************"); try { let g_object; let abnValue = 0.02; @@ -738,9 +737,9 @@ describe('objectStoreTest', function () { } catch (error) { console.info(error.code + error.message); } - console.log(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberAbnormal_0100 end *************"); + console.info(TAG + "************* SUB_DDM_AppDataFWK_Object_Api9_NumberAbnormal_0100 end *************"); done(); }) -console.log(TAG + "*************Unit Test End*************"); +console.info(TAG + "*************Unit Test End*************"); }) } \ No newline at end of file diff --git a/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreDistributedJsunit.test.js b/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreDistributedJsunit.test.js index e8dd3a7d33564f5868a746450fcbddd0eaeaf8c7..01127658d510b0fd914a00818b106d0ae6a817dd 100644 --- a/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreDistributedJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreDistributedJsunit.test.js @@ -17,6 +17,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from ' import data_Rdb from '@ohos.data.relationalStore'; import ability_featureAbility from '@ohos.ability.featureAbility'; +const ERRCODE = 801; var context = ability_featureAbility.getContext(); var sqlStatement = "CREATE TABLE IF NOT EXISTS employee (" + "id INTEGER PRIMARY KEY AUTOINCREMENT," + @@ -100,8 +101,8 @@ describe('relationalStoreDistributedTest', function () { console.info(TAG + "set none to be distributed table success"); expect(rdbStore).assertEqual(rdbStore) } catch (err) { - console.info(TAG + "set none to be distributed table failed"); - expect(null).assertFail(); + console.info(TAG + "setDistributed002 failed"+ `, error code is ${err.code}, message is ${err.message}`); + expect(err.code).assertEqual(ERRCODE); } done() console.info(TAG + "************* testRdbStoreDistributed002 end *************"); @@ -119,8 +120,8 @@ describe('relationalStoreDistributedTest', function () { console.info(TAG + "set employee to be distributed table success"); expect(rdbStore).assertEqual(rdbStore) } catch (err) { - console.info(TAG + "set employee to be distributed table failed"); - expect(null).assertFail(); + console.info(TAG + "setDistributed003 failed"+ `, error code is ${err.code}, message is ${err.message}`); + expect(err.code).assertEqual(ERRCODE); } done() console.info(TAG + "************* testRdbStoreDistributed003 end *************"); @@ -138,8 +139,8 @@ describe('relationalStoreDistributedTest', function () { console.info(TAG + "set employee and product to be distributed table success"); expect(rdbStore).assertEqual(rdbStore) } catch (err) { - console.info(TAG + "set employee and product to be distributed table failed"); - expect(null).assertFail(); + console.info(TAG + "setDistributed004 failed"+ `, error code is ${err.code}, message is ${err.message}`); + expect(err.code).assertEqual(ERRCODE); } done() console.info(TAG + "************* testRdbStoreDistributed004 end *************"); diff --git a/graphic/vkgl/src/deqpgles2/build0001/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0001/BUILD.gn index 86ef5cfea7730a0043ad00777d4e2181a02d31b3..29f57da423f4a213f30eec3ef13bdfb224721de5 100644 --- a/graphic/vkgl/src/deqpgles2/build0001/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0001/BUILD.gn @@ -45,6 +45,8 @@ ohos_static_library("libdeqpgles2func0001") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0001") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20001TestSuite.cpp", "../functional/Deqpgles2conversions_scalar_to_scalarTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0002/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0002/BUILD.gn index 15d8223c2526321a3088a492072b313e08af146e..0909976cce377080a56410b482bc4a2302e12ae1 100644 --- a/graphic/vkgl/src/deqpgles2/build0002/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0002/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0002") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0002") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20002TestSuite.cpp", "../functional/Deqpgles2conditionals_ifTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0003/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0003/BUILD.gn index 5f2bf00b38890df68610f75b310823d47a6a79c3..59bc0d11b62687bdc47672b4cfc41560201baf1a 100644 --- a/graphic/vkgl/src/deqpgles2/build0003/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0003/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0003") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0003") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20003TestSuite.cpp", "../functional/Deqpgles2functions_array_argumentsTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0004/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0004/BUILD.gn index 06b5e310af161fbeda23bf7d646d145a4f493d7d..dda54f824594394d3dcb41d73648d43849f49fb0 100644 --- a/graphic/vkgl/src/deqpgles2/build0004/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0004/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0004") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0004") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20004TestSuite.cpp", "../functional/Deqpgles2indexing_matrix_subscriptTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0005/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0005/BUILD.gn index 445c08d63f515843069b1773fa00dfd8e2c99d25..84c7507bbca0c1b0f5e5f6bb3f1201c4920521fc 100644 --- a/graphic/vkgl/src/deqpgles2/build0005/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0005/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0005") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0005") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20005TestSuite.cpp", "../functional/Deqpgles2binary_operator_addTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0006/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0006/BUILD.gn index a97cfa2a16433c803f9d56bccc7783f4df79910e..7367b629173597e24c98c702ce9c7413111237c2 100644 --- a/graphic/vkgl/src/deqpgles2/build0006/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0006/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0006") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0006") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20006TestSuite.cpp", "../functional/Deqpgles2angle_and_trigonometry_acosTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0007/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0007/BUILD.gn index 303db614e08ff4a8392b0e353b280fef6b741f9c..35059e2478288b7216408f4cf9f246c782a2fb89 100644 --- a/graphic/vkgl/src/deqpgles2/build0007/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0007/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0007") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0007") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20007TestSuite.cpp", "../functional/Deqpgles2bool_compare_allTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0008/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0008/BUILD.gn index 403a3108fc86cb7de3cf9edcbd5905b8200f740e..312362756443d996351e147909e94239f43e965d 100644 --- a/graphic/vkgl/src/deqpgles2/build0008/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0008/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0008") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0008") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20008TestSuite.cpp", "../functional/Deqpgles2builtin_functions_exponentialTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0009/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0009/BUILD.gn index 16dabbb9bf5bead8d2c4a08f19a702d1df34ea24..017c66596193cb1c161421aedddee5d05bec0fe8 100644 --- a/graphic/vkgl/src/deqpgles2/build0009/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0009/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0009") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0009") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20009TestSuite.cpp", "../functional/Deqpgles2basic_expression_combinedTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0010/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0010/BUILD.gn index 0b797803e1041a6d562d87ad10d42ad2bc69dc83..5b740b548cd3d48c08fbbc7ab69ad9c70506ccf0 100644 --- a/graphic/vkgl/src/deqpgles2/build0010/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0010/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0010") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0010") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20010TestSuite.cpp", "../functional/Deqpgles2comparison_ops_fragmentTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0011/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0011/BUILD.gn index 46a9753a39ce22584a98e21912395624adc6e963..8e9e00849d77372356eb4b9c61ae5b60f4d47165 100644 --- a/graphic/vkgl/src/deqpgles2/build0011/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0011/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0011") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0011") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20011TestSuite.cpp", "../functional/Deqpgles22d_affineTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0012/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0012/BUILD.gn index 4eff97bb34543495a27335356ee8ba26f10a4e33..a3534de6ea53929cc8ab55c0406c403a95f76e2c 100644 --- a/graphic/vkgl/src/deqpgles2/build0012/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0012/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0012") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0012") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20012TestSuite.cpp", "../functional/Deqpgles2blend_equation_src_func_dst_funcTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0013/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0013/BUILD.gn index ccce80b0108bcfeb9bcc27796c6a7ace27cd2e88..16a4837e325a2e143b3775049827250d75afd013 100644 --- a/graphic/vkgl/src/deqpgles2/build0013/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0013/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0013") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0013") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20013TestSuite.cpp", "../functional/Deqpgles2blend_rgb_equation_alpha_equationTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0014/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0014/BUILD.gn index ebfdc6fd35fd031ebcaac06652c8cffe03df0ac4..3daa499a137fd62c2222ed6d86a90c5fd426931d 100644 --- a/graphic/vkgl/src/deqpgles2/build0014/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0014/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0014") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0014") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20014TestSuite.cpp", "../functional/Deqpgles2attribute_location_bindTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0015/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0015/BUILD.gn index ac806e2a67016836c7158198822c81e4cee6b002..a94f20672afcb1b5a6ccad3113cc5a5456669de9 100644 --- a/graphic/vkgl/src/deqpgles2/build0015/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0015/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0015") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0015") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20015TestSuite.cpp", "../functional/Deqpgles2get_uniform_array_in_structTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0016/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0016/BUILD.gn index e542b491e2c977e73e4e0232199f5e1576240fa2..b3d906afebe4471c7eca4f6acb29e40d39607517 100644 --- a/graphic/vkgl/src/deqpgles2/build0016/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0016/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0016") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0016") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20016TestSuite.cpp", "../functional/Deqpgles2assigned_unused_uniformsTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles2/build0017/BUILD.gn b/graphic/vkgl/src/deqpgles2/build0017/BUILD.gn index cdd8e2cd92dcb0e386f154695e81c0a80da72428..2bd47c82577ed01ee4bb5fd6d58bedf647f8db7a 100644 --- a/graphic/vkgl/src/deqpgles2/build0017/BUILD.gn +++ b/graphic/vkgl/src/deqpgles2/build0017/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles2func0017") { } ohos_moduletest_suite("ActsDeqpgles2TestSuite0017") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles20017TestSuite.cpp", "../functional/Deqpgles2attach_deleted_inputTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0001/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0001/BUILD.gn index cf89c17209751abdda8bdfd91ae66dd3779165c6..cef4c5ef116acfed7b11cd8dd26a770b09c3e927 100644 --- a/graphic/vkgl/src/deqpgles3/build0001/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0001/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0001") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0001") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30001TestSuite.cpp", "../functional/Deqpgles3copy_basicTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0002/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0002/BUILD.gn index 82a8fa0272db6317b2fbd1c4e9d74d7db2e372e2..04918c54895160990614c884dbbb5024468ba785 100644 --- a/graphic/vkgl/src/deqpgles3/build0002/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0002/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0002") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0002") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30002TestSuite.cpp", "../functional/Deqpgles3conversions_scalar_to_scalarTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0003/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0003/BUILD.gn index 2c8b4368261ae4319dc45f4aea8c40f9956bd9bc..6a568a0f3503a7b32c6e90e38a22543b88594a4a 100644 --- a/graphic/vkgl/src/deqpgles3/build0003/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0003/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0003") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0003") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30003TestSuite.cpp", "../functional/Deqpgles3conditionals_ifTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0004/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0004/BUILD.gn index b1a4b15db55552053b831ecc1102abe6395532be..f8cc014f6d91cf3a58c22ffd82c68faeb8c2c372 100644 --- a/graphic/vkgl/src/deqpgles3/build0004/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0004/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0004") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0004") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30004TestSuite.cpp", "../functional/Deqpgles3swizzle_math_operations_vector_addTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0005/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0005/BUILD.gn index ecdb81ce3e2bd6ec907865cb20342957faa00378..6ae212beebf85ad50fb2c8ed2cc2ad269878ca30 100644 --- a/graphic/vkgl/src/deqpgles3/build0005/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0005/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0005") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0005") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30005TestSuite.cpp", "../functional/Deqpgles3arrays_complex_expressionTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0006/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0006/BUILD.gn index e0c95c17e08a6b41cce99ff01fed9059e6d24ca5..08b1ca65685640b3889e4689132a13faa64dc02c 100644 --- a/graphic/vkgl/src/deqpgles3/build0006/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0006/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0006") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0006") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30006TestSuite.cpp", "../functional/Deqpgles3indexing_varying_arrayTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0007/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0007/BUILD.gn index 4afbbab4baf6c93c74a9cbdb53191c05b704530f..cacb23131a9b22cd5de0bbfa28c0d7a078177888 100644 --- a/graphic/vkgl/src/deqpgles3/build0007/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0007/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0007") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0007") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30007TestSuite.cpp", "../functional/Deqpgles3indexing_matrix_subscriptTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0008/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0008/BUILD.gn index 70ebd74a775d91164e723f7745b97efb4b8364a1..b4d9b17cf1ae9de4f2941dce8ff7190b10eb1e70 100644 --- a/graphic/vkgl/src/deqpgles3/build0008/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0008/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0008") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0008") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30008TestSuite.cpp", "../functional/Deqpgles3loops_customTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0009/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0009/BUILD.gn index 548ae63447540414d700bfc6d99dbd1d19ff2560..dfd76d84d95ca774d2d3f4e86849f73573253ab4 100644 --- a/graphic/vkgl/src/deqpgles3/build0009/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0009/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0009") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0009") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30009TestSuite.cpp", "../functional/Deqpgles3binary_operator_addTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0010/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0010/BUILD.gn index 46536f5b492c318255ee12524804796e4995f4c3..b09c81e35cd0e96cf2ee0047b924f73944aa0368 100644 --- a/graphic/vkgl/src/deqpgles3/build0010/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0010/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0010") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0010") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30010TestSuite.cpp", "../functional/Deqpgles3binary_operator_add_assign_effectTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0011/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0011/BUILD.gn index 6e4d28d5d5436476a89393bc12218e5d67a4f4d0..c9210d2a365ff33d5c51e30b6df83aeedab4505e 100644 --- a/graphic/vkgl/src/deqpgles3/build0011/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0011/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0011") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0011") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30011TestSuite.cpp", "../functional/Deqpgles3binary_operator_add_assign_resultTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0012/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0012/BUILD.gn index 6dc62a3177372854c6daa613ef7f6cba6287a182..ef1c33a00efe1abee23ed8b2e904373cca8e9081 100644 --- a/graphic/vkgl/src/deqpgles3/build0012/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0012/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0012") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0012") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30012TestSuite.cpp", "../functional/Deqpgles3binary_operator_bitwise_and_assign_resultTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0013/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0013/BUILD.gn index d0aa807e20190239ea9156095236e430199d0407..b06825239167e7c7d11195612c3c5069d0cc845f 100644 --- a/graphic/vkgl/src/deqpgles3/build0013/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0013/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0013") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0013") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30013TestSuite.cpp", "../functional/Deqpgles3angle_and_trigonometry_acosTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0014/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0014/BUILD.gn index 8a2f8ab19cf8d3031440e1a108a06684aa62306e..63fb84eea02c29cbd3b57ec7fd8bb3b47a85fa2b 100644 --- a/graphic/vkgl/src/deqpgles3/build0014/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0014/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0014") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0014") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30014TestSuite.cpp", "../functional/Deqpgles3add_constTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0015/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0015/BUILD.gn index 06aacac034bb56b64cd6f15a10b1cc707c520a70..351c4486c52c941863bfeaa80fad5bd1998e4c89 100644 --- a/graphic/vkgl/src/deqpgles3/build0015/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0015/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0015") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0015") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30015TestSuite.cpp", "../functional/Deqpgles3mul_constTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0016/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0016/BUILD.gn index 3a8e67ebd831739201101818d3c417f108a6da75..359604760d8e74ae2e03ecf56e513dd16a619424 100644 --- a/graphic/vkgl/src/deqpgles3/build0016/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0016/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0016") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0016") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30016TestSuite.cpp", "../functional/Deqpgles3determinant_dynamicTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0017/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0017/BUILD.gn index 2f20114b19d9479ab37afad9e87184e708323ade..595314cb220022178d7ae0b81320a8ef8284481c 100644 --- a/graphic/vkgl/src/deqpgles3/build0017/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0017/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0017") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0017") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30017TestSuite.cpp", "../functional/Deqpgles3fragdepth_compareTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0018/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0018/BUILD.gn index f98e22bd2fac371aa43572e28035ff4b4a2cae5f..6c08cc42498fd4011f6805ba346d30ad55507fbf 100644 --- a/graphic/vkgl/src/deqpgles3/build0018/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0018/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0018") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0018") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30018TestSuite.cpp", "../functional/Deqpgles3common_absTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0019/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0019/BUILD.gn index 9db76ecb6493816ab0ffd279ba31de390fc0af7d..261446b8e2a46ff832c66ff952c95bd9af277067 100644 --- a/graphic/vkgl/src/deqpgles3/build0019/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0019/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0019") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0019") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30019TestSuite.cpp", "../functional/Deqpgles3abs_highp_fragmentTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0020/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0020/BUILD.gn index 971aac8b6686ec4d24f2674f7f36b5863f9b282e..66db88298db5f21ca802f196f0dc30fb4eb14833 100644 --- a/graphic/vkgl/src/deqpgles3/build0020/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0020/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0020") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0020") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30020TestSuite.cpp", "../functional/Deqpgles3basic_expression_vertexTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0021/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0021/BUILD.gn index f5d0b6d25afe1adddf1ff19998cba9d70b615b4f..a798be207984eee5f03f065f714a328ac7dfcf0f 100644 --- a/graphic/vkgl/src/deqpgles3/build0021/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0021/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0021") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0021") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30021TestSuite.cpp", "../functional/Deqpgles3basic_expression_combinedTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0022/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0022/BUILD.gn index 8bc3091070ae148f1b6b72db5451da3c78e368ea..0c810fdfb382c1bed9d75add220c489d46769d49 100644 --- a/graphic/vkgl/src/deqpgles3/build0022/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0022/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0022") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0022") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30022TestSuite.cpp", "../functional/Deqpgles3all_features_fragmentTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0023/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0023/BUILD.gn index 09fddcbc2ab06376c05a2b4c6d40571b091e1ec9..7797361783690390061158a6f9ac1c7eb65b96d6 100644 --- a/graphic/vkgl/src/deqpgles3/build0023/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0023/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0023") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0023") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30023TestSuite.cpp", "../functional/Deqpgles3format_compressedTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0024/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0024/BUILD.gn index 38a5f9b29298dc4e0de2838899ca3132b6c9b296..75a2d1441800a333c5f22b4f87355d1d88303c83 100644 --- a/graphic/vkgl/src/deqpgles3/build0024/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0024/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0024") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0024") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30024TestSuite.cpp", "../functional/Deqpgles32d_formatsTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0025/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0025/BUILD.gn index 344a631447322ea08bec3cfe817f4296a6ca8df7..b8c7a9962088dd0d2bc9ec0a413dcff04bbcffe4 100644 --- a/graphic/vkgl/src/deqpgles3/build0025/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0025/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0025") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0025") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30025TestSuite.cpp", "../functional/Deqpgles32d_affineTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0026/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0026/BUILD.gn index 19e12a76c41f90485f9796becb57a535f731dce4..ca6131a970b0d2a31a8dc65b4454babbc5a02474 100644 --- a/graphic/vkgl/src/deqpgles3/build0026/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0026/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0026") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0026") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30026TestSuite.cpp", "../functional/Deqpgles32d_array_linearTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0027/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0027/BUILD.gn index c2603051b04a43420536931c327cbb35a88e6947..1d1289a4f81b77e39911bbfdadfe2ee264459470 100644 --- a/graphic/vkgl/src/deqpgles3/build0027/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0027/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0027") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0027") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30027TestSuite.cpp", "../functional/Deqpgles32d_filteringTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0028/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0028/BUILD.gn index cba2550eae83137e552443e8d8919663c7c6e971..707a1c52777f7ccacbac724b9e0bfa75aef54d9c 100644 --- a/graphic/vkgl/src/deqpgles3/build0028/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0028/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0028") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0028") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30028TestSuite.cpp", "../functional/Deqpgles32_units_mixedTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0029/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0029/BUILD.gn index 51661b77ab9aee29a9777e80d419317c531c8347..d35ef91b2fe88436da7267c8c222fd6741910917 100644 --- a/graphic/vkgl/src/deqpgles3/build0029/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0029/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0029") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0029") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30029TestSuite.cpp", "../functional/Deqpgles3default_framebuffer_equation_src_func_dst_funcTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0030/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0030/BUILD.gn index 7e5db81e545dae8701caa8737ad2a8fec6b13bd5..72bb20ab56e73722eb0d2c8491b7e635bd7bb373 100644 --- a/graphic/vkgl/src/deqpgles3/build0030/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0030/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0030") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0030") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30030TestSuite.cpp", "../functional/Deqpgles3default_framebuffer_rgb_equation_alpha_equationTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0031/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0031/BUILD.gn index ef3378c2bc03fef458a33107a7561e9194010be6..fcd85f4045490621239e521743d72a7ae65a45d2 100644 --- a/graphic/vkgl/src/deqpgles3/build0031/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0031/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0031") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0031") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30031TestSuite.cpp", "../functional/Deqpgles3fbo_apiTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0032/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0032/BUILD.gn index 62edc12c1aae2df80b0f082daa51a32bee2aeace..d4d63eacac8dd8779a2e96402720dab13ee226d0 100644 --- a/graphic/vkgl/src/deqpgles3/build0032/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0032/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0032") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0032") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30032TestSuite.cpp", "../functional/Deqpgles3blit_tex2dTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0033/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0033/BUILD.gn index f0405561621326121f54f5b7355895388eacaf73..d80f1ca6475c2f779c1db8638461704b95461c25 100644 --- a/graphic/vkgl/src/deqpgles3/build0033/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0033/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0033") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0033") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30033TestSuite.cpp", "../functional/Deqpgles3blit_conversionTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0034/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0034/BUILD.gn index a124adeb6fdb2fa486d3ea9665acbd9c221132c7..e45f82f2f75f3914922aec86e5bbb7f9cd44517c 100644 --- a/graphic/vkgl/src/deqpgles3/build0034/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0034/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0034") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0034") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30034TestSuite.cpp", "../functional/Deqpgles3first_byteTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0035/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0035/BUILD.gn index 652e2d5393b79b0c0439ace750ea0c260668a36a..2fda731ec576c9ccccdcea1657d0f6fa78170bd6 100644 --- a/graphic/vkgl/src/deqpgles3/build0035/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0035/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0035") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0035") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30035TestSuite.cpp", "../functional/Deqpgles3single_basic_array_packedTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0036/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0036/BUILD.gn index e35ea2f99e696578d79e52afc43cfee0d9d1843e..5d3db3a43b0f26170fa72433f40cb30ba1263149 100644 --- a/graphic/vkgl/src/deqpgles3/build0036/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0036/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0036") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0036") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30036TestSuite.cpp", "../functional/Deqpgles3instance_array_basic_type_packedTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0037/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0037/BUILD.gn index 5858c62af7b68694aa6e0d0cb518db020d3b494c..c77b02a0969aff79b92c9bcebc7aa1960f447604 100644 --- a/graphic/vkgl/src/deqpgles3/build0037/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0037/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0037") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0037") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30037TestSuite.cpp", "../functional/Deqpgles3active_uniform_array_in_structTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0038/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0038/BUILD.gn index 3a389f72ad0e239c4f16e833950ae4438949d501..fbc7a71f6a38a5300e39124a2700a4f6b90f4d91 100644 --- a/graphic/vkgl/src/deqpgles3/build0038/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0038/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0038") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0038") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30038TestSuite.cpp", "../functional/Deqpgles3get_uniform_array_in_structTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0039/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0039/BUILD.gn index 2ef31e3a7eb0959cb4deb55f186bd65e14117ff5..58c233cb6a41d90b0ec426c3224918c75b8eda00 100644 --- a/graphic/vkgl/src/deqpgles3/build0039/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0039/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0039") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0039") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30039TestSuite.cpp", "../functional/Deqpgles3assigned_unused_uniformsTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0040/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0040/BUILD.gn index 45bdea24c653ad3633438f8ff8cc1271d78efd2a..6ab7572cccf1a304fbd6e93d939c80a83f675a8b 100644 --- a/graphic/vkgl/src/deqpgles3/build0040/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0040/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0040") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0040") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30040TestSuite.cpp", "../functional/Deqpgles3array_fixedTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0041/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0041/BUILD.gn index 721c41a42dda3bffb5e8d8d596ca231bfb1936b2..a12bcb904a982f99f34415274cb9e3e35593cab1 100644 --- a/graphic/vkgl/src/deqpgles3/build0041/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0041/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0041") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0041") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30041TestSuite.cpp", "../functional/Deqpgles3draw_arrays_instanced_attribute_divisorTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0042/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0042/BUILD.gn index 4c42227846abccebe0e256b1c13f8cf1dbc9af91..1da17d68ab1bd20036e4b8ea48181bafe998144e 100644 --- a/graphic/vkgl/src/deqpgles3/build0042/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0042/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0042") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0042") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30042TestSuite.cpp", "../functional/Deqpgles3functional_fence_syncTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0043/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0043/BUILD.gn index 410169b419347b3f6cf30c92ae1da1504cd58e73..eaad6a83b1a5f7937554240b08c08f2e1ea80633 100644 --- a/graphic/vkgl/src/deqpgles3/build0043/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0043/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0043") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0043") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30043TestSuite.cpp", "../functional/Deqpgles3dither_disabledTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0044/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0044/BUILD.gn index adef2120d891fc7246db43164c553aee1a16f341..14f9e96448628477af874c2458541ebe89ea778d 100644 --- a/graphic/vkgl/src/deqpgles3/build0044/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0044/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0044") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0044") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30044TestSuite.cpp", "../functional/Deqpgles3clipping_lineTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles3/build0045/BUILD.gn b/graphic/vkgl/src/deqpgles3/build0045/BUILD.gn index eace24ba783da6bde15cf0b1c27bd1d07452a9f9..7b28f5b45d71624cb45aae4b3d9a9ac70672f9fd 100644 --- a/graphic/vkgl/src/deqpgles3/build0045/BUILD.gn +++ b/graphic/vkgl/src/deqpgles3/build0045/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles3func0045") { } ohos_moduletest_suite("ActsDeqpgles3TestSuite0045") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles30045TestSuite.cpp", "../functional/Deqpgles3attach_deleted_inputTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0001/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0001/BUILD.gn index a0eee7607db7fa13f54febed95ea980bd358abf2..d74de6cc3c1ab6267d1ec2223802805dead4501e 100644 --- a/graphic/vkgl/src/deqpgles31/build0001/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0001/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0001") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0001") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310001TestSuite.cpp", "../functional/Deqpgles31builtin_functions_pack_unpackTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0002/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0002/BUILD.gn index d2e811aee70ac29985b5aea08d7372714274fb3e..d5c0641fb893febf4a5bb8acb61c9c754aa79ebe 100644 --- a/graphic/vkgl/src/deqpgles31/build0002/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0002/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0002") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0002") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310002TestSuite.cpp", "../functional/Deqpgles31integer_bitcountTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0003/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0003/BUILD.gn index 26ae677b965b36df7f32baeb20e972afbb215018..e70d4ea4ec1a3faac094739146fa509d12c3089b 100644 --- a/graphic/vkgl/src/deqpgles31/build0003/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0003/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0003") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0003") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310003TestSuite.cpp", "../functional/Deqpgles31abs_highp_computeTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0004/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0004/BUILD.gn index 3c4fec255ccbe413843479f93e7aea2493470c31..e62e23da2f461055db6c70a7ba2aabfc413a6249 100644 --- a/graphic/vkgl/src/deqpgles31/build0004/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0004/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0004") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0004") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310004TestSuite.cpp", "../functional/Deqpgles31const_expression_computeTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0005/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0005/BUILD.gn index 95e5ec5030277aef5f0aab7c94e19f93e5494f50..756d100e72b405b77f68fd06681eb8e3d163f3d0 100644 --- a/graphic/vkgl/src/deqpgles31/build0005/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0005/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0005") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0005") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310005TestSuite.cpp", "../functional/Deqpgles31assignment_explicit_to_explicitTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0006/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0006/BUILD.gn index 9b238d82f9e34b2bf1cc14b066b61ccd44d7dd15..d34cc8995819488d8e14518e42567f3589dfe453 100644 --- a/graphic/vkgl/src/deqpgles31/build0006/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0006/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0006") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0006") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310006TestSuite.cpp", "../functional/Deqpgles31array_subscripts_input_before_subscriptTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0007/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0007/BUILD.gn index 64c4fc0b4579bea3f5183b7b7e810304f3048f18..b7f40e544c073960647d52837d289165ca661c89 100644 --- a/graphic/vkgl/src/deqpgles31/build0007/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0007/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0007") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0007") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310007TestSuite.cpp", "../functional/Deqpgles31es32_functionsTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0008/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0008/BUILD.gn index 98ac29c9bb3d187e070a286e6d36f1ab878ef317..f90a4e64730a1568d2d9055063aa942088451fac 100644 --- a/graphic/vkgl/src/deqpgles31/build0008/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0008/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0008") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0008") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310008TestSuite.cpp", "../functional/Deqpgles31atomic_addTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0009/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0009/BUILD.gn index 2bf0edb81e533593572e01437371b7264bfc4670..d84cdae62122b320c189544b4089642ea96875ad 100644 --- a/graphic/vkgl/src/deqpgles31/build0009/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0009/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0009") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0009") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310009TestSuite.cpp", "../functional/Deqpgles31basic_unsized_array_sharedTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0010/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0010/BUILD.gn index 77d1cb433fb1a8ec5deb56bbe6b5fa573862384e..e0551acb8a96cb2bf302c008fca61ff8b16f10d9 100644 --- a/graphic/vkgl/src/deqpgles31/build0010/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0010/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0010") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0010") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310010TestSuite.cpp", "../functional/Deqpgles312_level_array_packedTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0011/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0011/BUILD.gn index a8a1f3dc5ece3440bc52cbd1ad090279f74d489b..ae1fd673947e267eb630362b99923fe89adee641 100644 --- a/graphic/vkgl/src/deqpgles31/build0011/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0011/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0011") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0011") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310011TestSuite.cpp", "../functional/Deqpgles31random_all_per_block_buffersTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0012/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0012/BUILD.gn index 899bf77e05a5f7ee5ee275b6f0bb11a6ec4f4cf3..4abb70895f84531a70588e8bf19738b6c130063c 100644 --- a/graphic/vkgl/src/deqpgles31/build0012/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0012/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0012") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0012") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310012TestSuite.cpp", "../functional/Deqpgles312_level_struct_array_per_block_bufferTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0013/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0013/BUILD.gn index a3259e8fa6e532a9c82a96f7049a48934bdcc9fb..1785c76ed760e221f4d8045728dceef6f3e3d4c3 100644 --- a/graphic/vkgl/src/deqpgles31/build0013/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0013/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0013") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0013") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310013TestSuite.cpp", "../functional/Deqpgles31atomic_counter_decTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0014/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0014/BUILD.gn index 7acd46d35ee944fea1c072f1f38cbcdf14359542..9d47d3b7d019efe7f28e1514dc2120f5178ff673 100644 --- a/graphic/vkgl/src/deqpgles31/build0014/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0014/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0014") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0014") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310014TestSuite.cpp", "../functional/Deqpgles31depth32f_base_levelTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0015/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0015/BUILD.gn index 947fb12f3754425d4a2b90425ae8551ba8f84520..958fc4d9663c9a3f3ee42ffa14831cace1df38d2 100644 --- a/graphic/vkgl/src/deqpgles31/build0015/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0015/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0015") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0015") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310015TestSuite.cpp", "../functional/Deqpgles31border_clamp_range_clampTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0016/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0016/BUILD.gn index 4f0f3f5bb167f00142e19e3e16327c84e3880169..d9784992649580d57dcc2664c81484a504587b68 100644 --- a/graphic/vkgl/src/deqpgles31/build0016/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0016/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0016") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0016") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310016TestSuite.cpp", "../functional/Deqpgles31internal_format_renderbufferTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0017/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0017/BUILD.gn index 613443d315e5e06800b90ad3e2a211fd8ce5f9ad..cc906bb6101b2c1df29419f2e8e77f1ce6383edb 100644 --- a/graphic/vkgl/src/deqpgles31/build0017/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0017/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0017") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0017") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310017TestSuite.cpp", "../functional/Deqpgles31geometry_shading_basicTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0018/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0018/BUILD.gn index f6c59c4d0c657943cdd813dc02ea9707eeaf008c..4ceb2724c6237167268f514426d3b9539ab74286 100644 --- a/graphic/vkgl/src/deqpgles31/build0018/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0018/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0018") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0018") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310018TestSuite.cpp", "../functional/Deqpgles31basic_array_assign_full_array_in_structTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0019/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0019/BUILD.gn index 81a5370fb5a53225230b2b69cf2e8ac87c6f4066..e511be6ef00333494964c1247bb8413abb85e2fd 100644 --- a/graphic/vkgl/src/deqpgles31/build0019/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0019/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0019") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0019") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310019TestSuite.cpp", "../functional/Deqpgles31callbacks_advanced_blendTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0020/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0020/BUILD.gn index 7c1b1d2e70d0e7d51b487ebf24db82d50bd921b4..9a8d4988cc21cb8db731c3ac86df752741d65a76 100644 --- a/graphic/vkgl/src/deqpgles31/build0020/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0020/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0020") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0020") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310020TestSuite.cpp", "../functional/Deqpgles31color_tex2dTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0021/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0021/BUILD.gn index 17a8fe6efb41c6f36e6837608dfc40cbc10bd1fa..77756004f57f1ede6ae7181940621632cd425db8 100644 --- a/graphic/vkgl/src/deqpgles31/build0021/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0021/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0021") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0021") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310021TestSuite.cpp", "../functional/Deqpgles31array_arrayTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0022/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0022/BUILD.gn index d6bb9ed13f00a2d3385aa1653da8e5bad53accde..aad82461fab5fe525d7ce58a04aaa8ee59368a71 100644 --- a/graphic/vkgl/src/deqpgles31/build0022/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0022/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0022") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0022") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310022TestSuite.cpp", "../functional/Deqpgles31array_size_separable_fragmentTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0023/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0023/BUILD.gn index cf1c6e93c168ab08123ed17d3aeb091a94255805..774181dc984b9d0cab9a3c488455c2e1bda10dd0 100644 --- a/graphic/vkgl/src/deqpgles31/build0023/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0023/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0023") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0023") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310023TestSuite.cpp", "../functional/Deqpgles31is_per_patch_separable_fragmentTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0024/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0024/BUILD.gn index 09e06f8ea225b7ab326320f275eb8b180f2e4a86..8e8f0d521f8f96cd3175ed58c19997430da3f23b 100644 --- a/graphic/vkgl/src/deqpgles31/build0024/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0024/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0024") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0024") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310024TestSuite.cpp", "../functional/Deqpgles31array_size_vertex_geo_fragmentTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0025/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0025/BUILD.gn index 3e4d8eb0efa0c3cbc490d7d5b37da61cc016f1d3..74d8e0229d93a708159d946b652d7ef67b5caad4 100644 --- a/graphic/vkgl/src/deqpgles31/build0025/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0025/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0025") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0025") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310025TestSuite.cpp", "../functional/Deqpgles31buffer_variable_randomTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0026/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0026/BUILD.gn index dfd3b272f387659be4467262495c57f13135d95a..abd2f793f0fc0e881793dbe603e01fe04f0c0f48 100644 --- a/graphic/vkgl/src/deqpgles31/build0026/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0026/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0026") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0026") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310026TestSuite.cpp", "../functional/Deqpgles31android_extension_pack_extensionsTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0027/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0027/BUILD.gn index 81ea8cbe6e90dfd13c773a288424fc51363327cf..7756a6385613db82522fe3f7d46efe5007ac3b48 100644 --- a/graphic/vkgl/src/deqpgles31/build0027/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0027/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0027") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0027") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310027TestSuite.cpp", "../functional/Deqpgles31viewclass_32_bits_r32f_r32fTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0028/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0028/BUILD.gn index 4db588735fa98ef2f1c9f83fc1f67e91e284ad2b..24da0e532262d45804cee3db2a2e177cfe76094d 100644 --- a/graphic/vkgl/src/deqpgles31/build0028/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0028/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0028") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0028") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310028TestSuite.cpp", "../functional/Deqpgles31viewclass_32_bits_r32i_rgb9_e5TestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0029/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0029/BUILD.gn index b93cd602db2e4f0ce28c35691d3a661a0d649993..12329edce71e379b8e6738f734bb89f50f6b506f 100644 --- a/graphic/vkgl/src/deqpgles31/build0029/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0029/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0029") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0029") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310029TestSuite.cpp", "../functional/Deqpgles31viewclass_32_bits_rg16ui_r11f_g11f_b10fTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0030/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0030/BUILD.gn index a69a70e174555bbfe985fe29341c91cec13b31b7..94fa37f424f4d7403835297ef7a4fc69d51784fe 100644 --- a/graphic/vkgl/src/deqpgles31/build0030/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0030/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0030") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0030") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310030TestSuite.cpp", "../functional/Deqpgles31viewclass_32_bits_r11f_g11f_b10f_r11f_g11f_b10fTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0031/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0031/BUILD.gn index 84709959829cf6b7bc79e81f79603724592976ff..3f7b089939bb70aabf1a694f2881e03b748e4712 100644 --- a/graphic/vkgl/src/deqpgles31/build0031/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0031/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0031") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0031") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310031TestSuite.cpp", "../functional/Deqpgles31viewclass_32_bits_rgb10_a2_r11f_g11f_b10fTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0032/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0032/BUILD.gn index 475a5d96571902cd0c863bac7de439f0671a31e1..4f731dc976951551ee8e61c5644ebb171a0ded24 100644 --- a/graphic/vkgl/src/deqpgles31/build0032/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0032/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0032") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0032") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310032TestSuite.cpp", "../functional/Deqpgles31viewclass_16_bits_r16f_r16fTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0033/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0033/BUILD.gn index 15e58144376d06bda32aeb6cd717d857ff5af2af..dfb3b8a853b0bfbd5244dff5a886e183741193a6 100644 --- a/graphic/vkgl/src/deqpgles31/build0033/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0033/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0033") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0033") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310033TestSuite.cpp", "../functional/Deqpgles31viewclass_16_bits_r16ui_rg8TestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0034/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0034/BUILD.gn index ff2dea6b0fef9d19366ea0dbe57a34ee8d34d3fd..4a36a417615b03718b9399501ca5be7224e8c808 100644 --- a/graphic/vkgl/src/deqpgles31/build0034/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0034/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0034") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0034") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310034TestSuite.cpp", "../functional/Deqpgles31viewclass_8_bits_r8_snorm_r8TestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0035/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0035/BUILD.gn index 29c3c57023f7a45b7d96e84a36233d3557e9f3b9..410527b83d0be8fe113b89cf6df99b99799f801b 100644 --- a/graphic/vkgl/src/deqpgles31/build0035/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0035/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0035") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0035") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310035TestSuite.cpp", "../functional/Deqpgles31viewclass_128_bits_mixed_rg11_eac_rgba32fTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0036/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0036/BUILD.gn index 6485f57623c59d2d7d163efc83da3a25ee39c810..4b8b05ab09d4b019882cc7ae7a5e8dc28488bca7 100644 --- a/graphic/vkgl/src/deqpgles31/build0036/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0036/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0036") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0036") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310036TestSuite.cpp", "../functional/Deqpgles31viewclass_128_bits_mixed_rg11_eac_rgba32uiTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0037/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0037/BUILD.gn index d0b243c7f5f4814a288a8cbc2a07f90bc5271b3d..8f8f5176ff9d3a7a4826eeb70c1ed80debc252c6 100644 --- a/graphic/vkgl/src/deqpgles31/build0037/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0037/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0037") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0037") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310037TestSuite.cpp", "../functional/Deqpgles31viewclass_128_bits_mixed_rg11_eac_rgba32iTestCase.cpp", diff --git a/graphic/vkgl/src/deqpgles31/build0038/BUILD.gn b/graphic/vkgl/src/deqpgles31/build0038/BUILD.gn index 5e99c09464001bcaf33306e1d5bad0f6c061b0bf..344b77dcd509220925b9687dad98476343a25283 100644 --- a/graphic/vkgl/src/deqpgles31/build0038/BUILD.gn +++ b/graphic/vkgl/src/deqpgles31/build0038/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libdeqpgles31func0038") { } ohos_moduletest_suite("ActsDeqpgles31TestSuite0038") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsDeqpgles310038TestSuite.cpp", "../functional/Deqpgles31draw_buffers_indexed_overwrite_commonTestCase.cpp", diff --git a/graphic/vkgl/src/khrgles2/build0001/BUILD.gn b/graphic/vkgl/src/khrgles2/build0001/BUILD.gn index 545ae34718dbab62985e6f0cec3bd266de0a703f..edd704323f6d17dceec59bf30da2bd862288f9d5 100644 --- a/graphic/vkgl/src/khrgles2/build0001/BUILD.gn +++ b/graphic/vkgl/src/khrgles2/build0001/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libkhrgles2func0001") { } ohos_moduletest_suite("ActsKhrgles2TestSuite0001") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsKhrgles20001TestSuite.cpp", "../core/Khrgles2internalformat_copy_tex_imageTestCase.cpp", diff --git a/graphic/vkgl/src/khrgles3/build0001/BUILD.gn b/graphic/vkgl/src/khrgles3/build0001/BUILD.gn index 75455b3212dc695f70f4ae3da0a7b091f9538c39..4fa2efffeddbde002d0acc8f216d8810cba0df6a 100644 --- a/graphic/vkgl/src/khrgles3/build0001/BUILD.gn +++ b/graphic/vkgl/src/khrgles3/build0001/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libkhrgles3func0001") { } ohos_moduletest_suite("ActsKhrgles3TestSuite0001") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsKhrgles30001TestSuite.cpp", "../shaders/Khrgles3declarations_declarationsTestCase.cpp", diff --git a/graphic/vkgl/src/khrgles3/build0002/BUILD.gn b/graphic/vkgl/src/khrgles3/build0002/BUILD.gn index 1bce5ce4e7ce93ee4c62bb8f3c31543e0809fc5e..a819335df471c0d0115d8683a61b71844bfb2518 100644 --- a/graphic/vkgl/src/khrgles3/build0002/BUILD.gn +++ b/graphic/vkgl/src/khrgles3/build0002/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libkhrgles3func0002") { } ohos_moduletest_suite("ActsKhrgles3TestSuite0002") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsKhrgles30002TestSuite.cpp", "../shaders/Khrgles3name_hiding_basicTestCase.cpp", diff --git a/graphic/vkgl/src/khrgles3/build0003/BUILD.gn b/graphic/vkgl/src/khrgles3/build0003/BUILD.gn index 4233e01b6e7ad07bb07e489edeb5cb0d1139d607..5cc0c318c0aa3486e1b3e47859ed854379161a0a 100644 --- a/graphic/vkgl/src/khrgles3/build0003/BUILD.gn +++ b/graphic/vkgl/src/khrgles3/build0003/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libkhrgles3func0003") { } ohos_moduletest_suite("ActsKhrgles3TestSuite0003") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsKhrgles30003TestSuite.cpp", "../shaders/Khrgles3instance_array_basic_type_packedTestCase.cpp", diff --git a/graphic/vkgl/src/khrgles3/build0004/BUILD.gn b/graphic/vkgl/src/khrgles3/build0004/BUILD.gn index bde35686283bd4c8ab903f74a780174d364bf4a6..0b034029fb8184cd5a92240b6e28c0bdf7e4ad43 100644 --- a/graphic/vkgl/src/khrgles3/build0004/BUILD.gn +++ b/graphic/vkgl/src/khrgles3/build0004/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libkhrgles3func0004") { } ohos_moduletest_suite("ActsKhrgles3TestSuite0004") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsKhrgles30004TestSuite.cpp", "../copy_tex_image_conversions/Khrgles3copy_tex_image_conversions_forbiddenTestCase.cpp", diff --git a/graphic/vkgl/src/khrgles3/build0005/BUILD.gn b/graphic/vkgl/src/khrgles3/build0005/BUILD.gn index 456a6222f7f56a9e58aedf5c1b4db28e0a7a7567..43477da51248eae5a70f2f24d6485d03203dbe03 100644 --- a/graphic/vkgl/src/khrgles3/build0005/BUILD.gn +++ b/graphic/vkgl/src/khrgles3/build0005/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libkhrgles3func0005") { } ohos_moduletest_suite("ActsKhrgles3TestSuite0005") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsKhrgles30005TestSuite.cpp", "../number_parsing/Khrgles3KHR-GLES3_number_parsingTestCase.cpp", diff --git a/graphic/vkgl/src/khrgles31/build0001/BUILD.gn b/graphic/vkgl/src/khrgles31/build0001/BUILD.gn index 20386fab89461652541ccdb49af48e1f825516b7..ecb7aa41f9e7091fe48b53810fc69e3381b27cd8 100644 --- a/graphic/vkgl/src/khrgles31/build0001/BUILD.gn +++ b/graphic/vkgl/src/khrgles31/build0001/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libkhrgles31func0001") { } ohos_moduletest_suite("ActsKhrgles31TestSuite0001") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsKhrgles310001TestSuite.cpp", "../core/Khrgles31base_rgba32fTestCase.cpp", diff --git a/graphic/vkgl/src/khrgles31/build0002/BUILD.gn b/graphic/vkgl/src/khrgles31/build0002/BUILD.gn index 5cdb0631823cbe587a9e319c33567bdf52ae3444..24701092ca6d56030afbae30f35d1091e176a9b2 100644 --- a/graphic/vkgl/src/khrgles31/build0002/BUILD.gn +++ b/graphic/vkgl/src/khrgles31/build0002/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libkhrgles31func0002") { } ohos_moduletest_suite("ActsKhrgles31TestSuite0002") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsKhrgles310002TestSuite.cpp", "../core/Khrgles31blend_equation_advanced_BlendEquationSeparateTestCase.cpp", diff --git a/graphic/vkgl/src/khrgles31/build0003/BUILD.gn b/graphic/vkgl/src/khrgles31/build0003/BUILD.gn index 916059ddb56366a2df8d7b331f353a3fa109e1de..f1848b52689ef689b50bb8e24b55966c59ee09c4 100644 --- a/graphic/vkgl/src/khrgles31/build0003/BUILD.gn +++ b/graphic/vkgl/src/khrgles31/build0003/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libkhrgles31func0003") { } ohos_moduletest_suite("ActsKhrgles31TestSuite0003") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsKhrgles310003TestSuite.cpp", "../core/Khrgles31compressed_format_apiTestCase.cpp", diff --git a/graphic/vkgl/src/khrgles31/build0004/BUILD.gn b/graphic/vkgl/src/khrgles31/build0004/BUILD.gn index e998aba93bd3c9345916ba61ccf1a72320f0de15..e4dbdf4a596ba21c8ff2fd572e3f6b44e941311a 100644 --- a/graphic/vkgl/src/khrgles31/build0004/BUILD.gn +++ b/graphic/vkgl/src/khrgles31/build0004/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libkhrgles31func0004") { } ohos_moduletest_suite("ActsKhrgles31TestSuite0004") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsKhrgles310004TestSuite.cpp", "../core/Khrgles31teximage3d_r11g11b10fTestCase.cpp", diff --git a/graphic/vkgl/src/khrgles32/build0001/BUILD.gn b/graphic/vkgl/src/khrgles32/build0001/BUILD.gn index 394afa937ddc84c3995f42d7ccb2527ca68132c5..8565dbe56e1f9fe90d2dfc99c44358e1e4d1f62b 100644 --- a/graphic/vkgl/src/khrgles32/build0001/BUILD.gn +++ b/graphic/vkgl/src/khrgles32/build0001/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libkhrgles32func0001") { } ohos_moduletest_suite("ActsKhrgles32TestSuite0001") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsKhrgles320001TestSuite.cpp", "../core/Khrgles32core_constant_expressionsTestCase.cpp", diff --git a/graphic/vkgl/src/khrgles32/build0002/BUILD.gn b/graphic/vkgl/src/khrgles32/build0002/BUILD.gn index e16fee6916b845ac64dd9162ed44f3444c137cbc..0e37f5c18d72d961764bfd7d9e4c830936ebbeb6 100644 --- a/graphic/vkgl/src/khrgles32/build0002/BUILD.gn +++ b/graphic/vkgl/src/khrgles32/build0002/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libkhrgles32func0002") { } ohos_moduletest_suite("ActsKhrgles32TestSuite0002") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsKhrgles320002TestSuite.cpp", "../core/Khrgles32compressed_format_apiTestCase.cpp", diff --git a/graphic/vkgl/src/khrglesext/build0001/BUILD.gn b/graphic/vkgl/src/khrglesext/build0001/BUILD.gn index 9e2c161f4846fa2ea7a1d6a143e4813e4d5a18c8..8879dfbe684f9321586bddacb3b3c61fc098c44a 100644 --- a/graphic/vkgl/src/khrglesext/build0001/BUILD.gn +++ b/graphic/vkgl/src/khrglesext/build0001/BUILD.gn @@ -39,6 +39,8 @@ ohos_static_library("libkhrglesextfunc0001") { } ohos_moduletest_suite("ActsKhrglesextTestSuite0001") { + subsystem_name = "graphic" + part_name = "graphic_standard" sources = [ "../ActsKhrglesext0001TestSuite.cpp", "../disjoint_timer_query/KhrglesextKHR-GLESEXT_disjoint_timer_queryTestCase.cpp", diff --git a/inputmethod/BUILD.gn b/inputmethod/BUILD.gn index c14bb038ca6de1cdf73711743ae8c6b9810c86b0..adde2230efb000f92aeefeb66b68c9a27789bbe3 100644 --- a/inputmethod/BUILD.gn +++ b/inputmethod/BUILD.gn @@ -15,6 +15,7 @@ import("//build/ohos_var.gni") group("inputmethod") { testonly = true deps = [ + "InputMethodEngine:ActsInputMethodEngineTest", "InputMethodTest_Stage:ActsImeAbilityTest", "InputMethodTest_ets:ActsInputMethodEtsTest", ] diff --git a/inputmethod/InputMethodEngine/AppScope/app.json b/inputmethod/InputMethodEngine/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..191de9d4f1e09984f8400e1f7b5aa539579992be --- /dev/null +++ b/inputmethod/InputMethodEngine/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app":{ + "bundleName":"com.acts.inputmethodengine.test", + "vendor":"hw", + "versionCode":1000000, + "versionName":"1.0.0", + "debug":false, + "icon":"$media:icon", + "label":"$string:app_name", + "description":"$string:description_application", + "distributedNotificationEnabled":true, + "keepAlive":true, + "singleUser":true, + "minAPIVersion":8, + "targetAPIVersion":8, + "car":{ + "apiCompatibleVersion":8, + "singleUser":false + } + } +} diff --git a/inputmethod/InputMethodEngine/AppScope/resources/base/element/string.json b/inputmethod/InputMethodEngine/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..ee69f9a861d9dc269ed6638735d52674583498e1 --- /dev/null +++ b/inputmethod/InputMethodEngine/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"ohosProject" + } + ] +} \ No newline at end of file diff --git a/inputmethod/InputMethodEngine/AppScope/resources/base/media/app_icon.png b/inputmethod/InputMethodEngine/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/inputmethod/InputMethodEngine/AppScope/resources/base/media/app_icon.png differ diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/BUILD.gn b/inputmethod/InputMethodEngine/BUILD.gn old mode 100755 new mode 100644 similarity index 67% rename from ability/ability_runtime/non_concurrent/actsthirdappatest/BUILD.gn rename to inputmethod/InputMethodEngine/BUILD.gn index 55e5f826042836c5b7402778a1d33c54078b4779..e5c437db563364e8c11f632ba6f488ad49f1dcde --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/BUILD.gn +++ b/inputmethod/InputMethodEngine/BUILD.gn @@ -13,31 +13,31 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsThirdAppATest") { +ohos_js_hap_suite("ActsInputMethodEngineTest") { hap_profile = "entry/src/main/module.json" js_build_mode = "debug" deps = [ - ":actsthirdappatest_ets_assets", - ":actsthirdappatest_resources", + ":IMExtAbility_ets_assets", + ":IMExtAbility_resources", ] ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsThirdAppATest" - subsystem_name = "ability" - part_name = "ability_runtime" + certificate_profile = "signature/ActsInputMethodEngineTest.p7b" + hap_name = "ActsInputMethodEngineTest" + subsystem_name = "inputmethod" + part_name = "imf" } -ohos_app_scope("actsthirdappatest_app_profile") { +ohos_app_scope("IMExtAbility_app_profile") { app_profile = "AppScope/app.json" sources = [ "AppScope/resources" ] } -ohos_js_assets("actsthirdappatest_ets_assets") { +ohos_js_assets("IMExtAbility_ets_assets") { source_dir = "entry/src/main/ets" } -ohos_resources("actsthirdappatest_resources") { +ohos_resources("IMExtAbility_resources") { sources = [ "entry/src/main/resources" ] - deps = [ ":actsthirdappatest_app_profile" ] + deps = [ ":IMExtAbility_app_profile" ] hap_profile = "entry/src/main/module.json" } diff --git a/inputmethod/InputMethodEngine/Test.json b/inputmethod/InputMethodEngine/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..c836f7fcc71bc99a266dce9ad629a0f74395c1e5 --- /dev/null +++ b/inputmethod/InputMethodEngine/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "180000", + "bundle-name": "com.acts.inputmethodengine.test", + "module-name": "phone", + "shell-timeout": "600000", + "testcase-timeout": 15000 + }, + "kits": [{ + "test-file-name": [ + "ActsInputMethodEngineTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }] +} diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/TestAbility/pages/index.ets b/inputmethod/InputMethodEngine/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 68% rename from ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/TestAbility/pages/index.ets rename to inputmethod/InputMethodEngine/entry/src/main/ets/Application/AbilityStage.ts index 8696b447105ac93a6df1472539ab155300de7677..19fca6496cac2b39252aa3fa7047f229d387c351 --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/TestAbility/pages/index.ets +++ b/inputmethod/InputMethodEngine/entry/src/main/ets/Application/AbilityStage.ts @@ -12,16 +12,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@Entry -@Component -struct Index { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('页面1') - .fontSize(50) - .fontWeight(FontWeight.Bold) +import AbilityStage from "@ohos.app.ability.AbilityStage"; + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate"); + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; } - .width('100%') - .height('100%') - } -} \ No newline at end of file +} diff --git a/inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/InputStageService.ts b/inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/InputStageService.ts new file mode 100644 index 0000000000000000000000000000000000000000..9d029f26f0ba0a3c2583de24a910ef0fb79819bb --- /dev/null +++ b/inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/InputStageService.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import InputMethodExtensionAbility from '@ohos.InputMethodExtensionAbility'; +import { KeyboardDelegate } from './KeyboardDelegate'; + +export default class InputDemoService extends InputMethodExtensionAbility { + private keyboardDelegate: KeyboardDelegate; + + onCreate(want) { + this.keyboardDelegate = new KeyboardDelegate(this.context); + this.keyboardDelegate.onCreate(); // 初始化窗口 + } + + onDestroy() { + console.log("onDestroy inputStageService**"); + this.context.destroy(); + } +} \ No newline at end of file diff --git a/inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/KeyboardDelegate.ts b/inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/KeyboardDelegate.ts new file mode 100644 index 0000000000000000000000000000000000000000..ea466e4be5e42c48d3ea7bdf91dbbd19357ac6d8 --- /dev/null +++ b/inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/KeyboardDelegate.ts @@ -0,0 +1,1127 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import inputMethodEngine from '@ohos.inputMethodEngine'; +import display from '@ohos.display'; +import windowManager from '@ohos.window'; +import promptAction from '@ohos.promptAction'; +import commoneventmanager from '@ohos.commonEventManager'; + +let inputMethodAbility = inputMethodEngine.getInputMethodAbility(); +let inputKeyboardDelegate = inputMethodEngine.getKeyboardDelegate(); + +const TAG = 'KeyboardDelegate'; + +export class KeyboardDelegate { + mContext; + WINDOW_TYPE_INPUT_METHOD_FLOAT = 2105; + windowName = 'inputApp'; + private windowHeight: number = 0; + private windowWidth: number = 0; + private nonBarPosition: number = 0; + + constructor(context) { + this.mContext = context; + } + + public onCreate(): void { + this.initWindow(); + let that = this; + + function subscriberCallback(err, data) { + console.debug(TAG + '====>receive event err:' + JSON.stringify(err)); + console.debug(TAG + '====>receive event data:' + JSON.stringify(data)); + switch (data.code) { + case 1: + console.debug(TAG + '====>inputMethodAbility_test_getInputMethodAbility_001 event:' + data.event); + that.inputMethodAbility_test_getInputMethodAbility_001(); + break; + case 2: + console.debug(TAG + '====>inputMethodAbility_test_getInputMethodDelegate_001 event:' + data.event); + that.inputMethodAbility_test_getKeyboardDelegate_001(); + break; + case 28: + console.debug(TAG + '====>inputMethodAbility_test_028 event:' + data.event); + that.inputMethodAbility_test_028(); + break; + case 29: + console.debug(TAG + '====>inputMethodAbility_test_029 event:' + data.event); + that.inputMethodAbility_test_029(); + break; + case 30: + console.debug(TAG + '====>inputMethodAbility_test_030 event:' + data.event); + that.inputMethodAbility_test_030(); + break; + case 31: + console.debug(TAG + '====>inputMethodAbility_test_031 event:' + data.event); + that.inputMethodAbility_test_031(); + break; + case 32: + console.debug(TAG + '====>inputMethodAbility_test_032 event:' + data.event); + that.inputMethodAbility_test_032(); + break; + case 33: + console.debug(TAG + '====>inputMethodAbility_test_033 event:' + data.event); + that.inputMethodAbility_test_033(); + break; + case 34: + console.debug(TAG + '====>inputMethodAbility_test_034 event:' + data.event); + that.inputMethodAbility_test_034(); + break; + case 35: + console.debug(TAG + '====>inputMethodAbility_test_035 event:' + data.event); + that.inputMethodAbility_test_035(); + break; + case 36: + console.debug(TAG + '====>inputMethodAbility_test_036 event:' + data.event); + that.inputMethodAbility_test_036(); + break; + case 37: + console.debug(TAG + '====>inputMethodAbility_test_037 event:' + data.event); + that.inputMethodAbility_test_037(); + break; + case 38: + console.debug(TAG + '====>inputMethodAbility_test_038 event:' + data.event); + that.inputMethodAbility_test_038(); + break; + case 39: + console.debug(TAG + '====>inputMethodAbility_test_039 event:' + data.event); + that.inputMethodAbility_test_039(); + break; + case 40: + console.debug(TAG + '====>inputMethodAbility_test_040 event:' + data.event); + that.inputMethodAbility_test_040(); + break; + case 41: + console.debug(TAG + '====>inputMethodAbility_test_041 event:' + data.event); + that.inputMethodAbility_test_041(); + break; + case 42: + console.debug(TAG + '====>inputMethodAbility_test_042 event:' + data.event); + that.inputMethodAbility_test_042(); + break; + case 43: + console.debug(TAG + '====>inputMethodAbility_test_043 event:' + data.event); + that.inputMethodAbility_test_043(); + break; + case 45: + console.debug(TAG + '====>inputMethodAbility_test_045 event:' + data.event); + that.inputMethodAbility_test_045(); + break; + case 46: + console.debug(TAG + '====>inputMethodAbility_test_046 event:' + data.event); + that.inputMethodAbility_test_046(); + break; + case 47: + console.debug(TAG + '====>inputMethodAbility_test_047 event:' + data.event); + that.inputMethodAbility_test_047(); + break; + case 48: + console.debug(TAG + '====>inputMethodAbility_test_048 event:' + data.event); + that.inputMethodAbility_test_048(); + break; + case 49: + console.debug(TAG + '====>inputMethodAbility_test_049 event:' + data.event); + that.inputMethodAbility_test_049(); + break; + case 50: + console.debug(TAG + '====>inputMethodAbility_test_050 event:' + data.event); + that.inputMethodAbility_test_050(); + break; + case 101: + console.debug(TAG + '====>inputMethodAbility_test_0101 event:' + data.event); + that.inputMethodAbility_test_101(); + break; + case 102: + console.debug(TAG + '====>inputMethodAbility_test_0102 event:' + data.event); + that.inputMethodAbility_test_102(); + break; + case 103: + console.debug(TAG + '====>inputMethodAbility_test_0103 event:' + data.event); + that.inputMethodAbility_test_103(); + break; + case 104: + console.debug(TAG + '====>inputMethodAbility_test_0104 event:' + data.event); + that.inputMethodAbility_test_104(); + break; + case 105: + console.debug(TAG + '====>inputMethodAbility_test_0105 event:' + data.event); + that.inputMethodAbility_test_105(); + break; + case 106: + console.debug(TAG + '====>inputMethodAbility_test_0106 event:' + data.event); + that.inputMethodAbility_test_106(); + break; + } + } + + var commonEventSubscribeInfo = { + events: ["test"] + }; + + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then(function (data) { + subscriber = data; + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug(TAG + '====>scene subscribe finish===='); + }); + } + + public initWindow(): void { + let dis = display.getDefaultDisplaySync(); + var dWidth = dis.width; + var dHeight = dis.height; + var keyHeightRate = 0.47; + var keyHeight = dHeight * keyHeightRate; + this.windowWidth = dWidth; + this.windowHeight = keyHeight; + this.nonBarPosition = dHeight - keyHeight; + + var config = { + name: this.windowName, + windowType: this.WINDOW_TYPE_INPUT_METHOD_FLOAT, + cts: this.mContext + }; + + windowManager.createWindow(config).then((win) => { + win.resize(dWidth, keyHeight).then(() => { + win.moveWindowTo(0, this.nonBarPosition).then(() => { + win.setUIContent('page/service/index').then(() => { + }); + }); + }); + }); + } + + public onDestroy(): void { + console.debug(TAG + '====>onDestroy'); + globalThis.textInputClient.getTextIndexAtCursor().then((index) => { + console.debug(TAG + '====>getTextIndexAtCursor index:' + index); + promptAction.showToast({ message: 'getTextIndexAtCursor success' + index, duration: 200, bottom: 500 }); + var win = windowManager.findWindow(this.windowName); + win.destroyWindow(); + this.mContext.terminateSelf(); + return true; + }).catch((err) => { + promptAction.showToast({ message: 'getTextIndexAtCursor failed', duration: 200, bottom: 500 }); + }); + } + + private publishCallback(err): void { + if (err) { + console.error(TAG + '====>publish failed:' + JSON.stringify(err)); + } else { + console.debug(TAG + '====>publish'); + } + } + + private inputMethodAbility_test_getInputMethodAbility_001(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_getInputMethodAbility_001 data'); + if (typeof(inputMethodAbility) === 'object') { + console.debug(TAG + '====>inputMethodAbility_test_getInputMethodAbility_001 success'); + var commonEventPublishData = { + data: "SUCCESS" + }; + } else { + console.debug(TAG + '====>inputMethodAbility_test_getInputMethodAbility_001 failed'); + var commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodAbility_test_getInputMethodAbility_001", commonEventPublishData, this.publishCallback); + } + + private inputMethodAbility_test_getKeyboardDelegate_001(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_getKeyboardDelegate_001 data'); + if (typeof (inputKeyboardDelegate) === 'object') { + console.debug(TAG + '====>inputMethodAbility_test_getKeyboardDelegate_001 success'); + var commonEventPublishData = { + data: "SUCCESS" + }; + } else { + console.debug(TAG + '====>inputMethodAbility_test_getKeyboardDelegate_001 failed'); + var commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodAbility_test_getKeyboardDelegate_001", commonEventPublishData, this.publishCallback); + } + + private inputMethodAbility_test_028(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_028 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_028", commonEventPublishData, this.publishCallback); + } else { + let editorAttribyte = await InputClient.getEditorAttribute(); + console.debug(TAG + '====>inputMethodAbility_test_028 editorAttribyte:' + JSON.stringify(editorAttribyte)); + InputClient.sendKeyFunction(editorAttribyte.enterKeyType, (err, value) => { + if (err) { + console.debug(TAG + '====>inputMethodAbility_test_028 sendKeyFunction err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodAbility_test_028 sendKeyFunction value:' + JSON.stringify(value)); + if (value) { + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + } + commoneventmanager.publish("inputMethodAbility_test_028", commonEventPublishData, this.publishCallback); + }); + } + }); + } + + private inputMethodAbility_test_029(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_029 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_029", commonEventPublishData, this.publishCallback); + } else { + let editorAttribyte = await InputClient.getEditorAttribute(); + console.debug(TAG + '====>inputMethodAbility_test_029 editorAttribyte:' + JSON.stringify(editorAttribyte)); + let value = InputClient.sendKeyFunction(editorAttribyte.enterKeyType); + console.debug(TAG + '====>inputMethodAbility_test_029 sendKeyFunction value:' + JSON.stringify(value)); + if (value) { + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodAbility_test_029", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodAbility_test_030(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_030 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_030", commonEventPublishData, this.publishCallback); + } else { + InputClient.deleteForward(1, (err, value) => { + if (err) { + console.debug(TAG + '====>inputMethodAbility_test_030 deleteForward err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodAbility_test_030 deleteForward value:' + JSON.stringify(value)); + if (typeof value === 'boolean') { + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + } + commoneventmanager.publish("inputMethodAbility_test_030", commonEventPublishData, this.publishCallback); + }); + } + }); + } + + private inputMethodAbility_test_031(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_031 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_031", commonEventPublishData, this.publishCallback); + } else { + let value = await InputClient.deleteForward(1); + console.debug(TAG + '====>inputMethodAbility_test_031 deleteForward value:' + value); + if (typeof value === 'boolean') { + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodAbility_test_031", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodAbility_test_032(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_032 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_032", commonEventPublishData, this.publishCallback); + } else { + InputClient.deleteBackward(1, (err, value) => { + if (err) { + console.debug(TAG + '====>inputMethodAbility_test_032 deleteBackward err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodAbility_test_032 deleteBackward value:' + JSON.stringify(value)); + if (value) { + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + } + commoneventmanager.publish("inputMethodAbility_test_032", commonEventPublishData, this.publishCallback); + }); + } + }); + } + + private inputMethodAbility_test_033(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_033 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_033", commonEventPublishData, this.publishCallback); + } else { + let value = await InputClient.deleteBackward(1); + console.debug(TAG + '====>inputMethodAbility_test_033 deleteBackward value:' + JSON.stringify(value)); + if (value) { + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodAbility_test_033", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodAbility_test_034(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_034 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_034", commonEventPublishData, this.publishCallback); + } else { + InputClient.insertText('test', (err, value) => { + if (err) { + console.debug(TAG + '====>inputMethodAbility_test_034 insertText err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodAbility_test_034 insertText value:' + JSON.stringify(value)); + if (value) { + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + } + commoneventmanager.publish("inputMethodAbility_test_034", commonEventPublishData, this.publishCallback); + }); + } + }); + } + + private inputMethodAbility_test_035(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_035 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_035", commonEventPublishData, this.publishCallback); + } else { + let value = InputClient.insertText('test'); + console.debug(TAG + '====>inputMethodAbility_test_035 insertText value:' + JSON.stringify(value)); + if (value) { + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodAbility_test_035", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodAbility_test_036(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_036 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_036", commonEventPublishData, this.publishCallback); + } else { + InputClient.getForward(1, (err, value) => { + if (err) { + console.debug(TAG + '====>inputMethodAbility_test_036 getForward err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodAbility_test_036 getForward value:' + JSON.stringify(value)); + if (value) { + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + } + commoneventmanager.publish("inputMethodAbility_test_036", commonEventPublishData, this.publishCallback); + }); + } + }); + } + + private inputMethodAbility_test_037(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_037 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_037", commonEventPublishData, this.publishCallback); + } else { + let value = InputClient.getForward(1); + console.debug(TAG + '====>inputMethodAbility_test_037 getForward value' + JSON.stringify(value)); + if (value) { + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodAbility_test_037", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodAbility_test_038(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_038 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_038", commonEventPublishData, this.publishCallback); + } else { + InputClient.getEditorAttribute((err, value) => { + if (err) { + console.debug(TAG + '====>inputMethodAbility_test_038 getEditorAttribute err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodAbility_test_038 getEditorAttribute value:' + JSON.stringify(value)); + if (value) { + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + } + commoneventmanager.publish("inputMethodAbility_test_038", commonEventPublishData, this.publishCallback); + }); + } + }); + } + + private inputMethodAbility_test_039(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_039 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_039", commonEventPublishData, this.publishCallback); + } else { + let value = InputClient.getEditorAttribute(); + console.debug(TAG + '====>inputMethodAbility_test_039 getEditorAttribute value:' + JSON.stringify(value)); + if (value) { + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodAbility_test_039", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodAbility_test_040(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_040 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_040", commonEventPublishData, this.publishCallback); + } else { + try { + KeyboardDelegate.hideKeyboard((err, value) => { + if (err) { + console.debug(TAG + '====>inputMethodAbility_test_040 hideKeyboard err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + commonEventPublishData = { + data: "SUCCESS" + }; + } + commoneventmanager.publish("inputMethodAbility_test_040", commonEventPublishData, this.publishCallback); + }); + } catch (err) { + commonEventPublishData = { + data: "FAILED" + }; + console.debug(TAG + '====>inputMethodAbility_test_040 hideKeyboard throw_err:'); + commoneventmanager.publish("inputMethodAbility_test_040", commonEventPublishData, this.publishCallback); + } + } + }); + } + + private inputMethodAbility_test_041(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_041 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_041", commonEventPublishData, this.publishCallback); + } else { + try { + await KeyboardDelegate.hideKeyboard(); + console.debug(TAG + '====>inputMethodAbility_test_041 hideKeyboard success'); + commonEventPublishData = { + data: "SUCCESS" + }; + } catch (err) { + commonEventPublishData = { + data: "FAILED" + }; + console.debug(TAG + '====>inputMethodAbility_test_041 hideKeyboard catch err:' + JSON.stringify(err)); + } + commoneventmanager.publish("inputMethodAbility_test_041", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodAbility_test_042(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_042 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_042", commonEventPublishData, this.publishCallback); + } else { + InputClient.getBackward(1, (err, value) => { + if (err) { + console.debug(TAG + '====>inputMethodAbility_test_042 getBackward err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodAbility_test_042 getBackward value:' + JSON.stringify(value)); + commonEventPublishData = { + data: "SUCCESS" + }; + } + commoneventmanager.publish("inputMethodAbility_test_042", commonEventPublishData, this.publishCallback); + }); + } + }); + } + + private inputMethodAbility_test_043(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_043 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_043", commonEventPublishData, this.publishCallback); + } else { + let value = InputClient.getBackward(1); + console.debug(TAG + '====>inputMethodAbility_test_043 getBackward value:' + JSON.stringify(value)); + commonEventPublishData = { + data: "SUCCESS" + }; + commoneventmanager.publish("inputMethodAbility_test_043", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodAbility_test_045(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_045 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + setTimeout(()=>{ + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_045", commonEventPublishData, this.publishCallback); + } else { + InputClient.moveCursor(inputMethodEngine.CURSOR_UP, (err, value) => { + if (err) { + console.debug(TAG + '====>inputMethodAbility_test_045 CURSOR_UP err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodAbility_test_045 CURSOR_UP value:' + JSON.stringify(value)); + commonEventPublishData = { + data: "SUCCESS" + }; + } + commoneventmanager.publish("inputMethodAbility_test_045", commonEventPublishData, this.publishCallback); + }); + } + },1000); + + }); + } + + private inputMethodAbility_test_046(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_046 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_046", commonEventPublishData, this.publishCallback); + } else { + InputClient.moveCursor(inputMethodEngine.CURSOR_DOWN, (err, value) => { + if (err) { + console.debug(TAG + '====>inputMethodAbility_test_046 CURSOR_DOWN err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodAbility_test_046 CURSOR_DOWN value:' + JSON.stringify(value)); + commonEventPublishData = { + data: "SUCCESS" + }; + } + commoneventmanager.publish("inputMethodAbility_test_046", commonEventPublishData, this.publishCallback); + }); + } + }); + } + + private inputMethodAbility_test_047(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_047 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_047", commonEventPublishData, this.publishCallback); + } else { + await InputClient.moveCursor(inputMethodEngine.CURSOR_LEFT); + console.debug(TAG + '====>inputMethodAbility_test_047 CURSOR_LEFT success'); + commonEventPublishData = { + data: "SUCCESS" + }; + commoneventmanager.publish("inputMethodAbility_test_047", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodAbility_test_048(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_048 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_048", commonEventPublishData, this.publishCallback); + } else { + await InputClient.moveCursor(inputMethodEngine.CURSOR_RIGHT); + console.debug(TAG + '====>inputMethodAbility_test_048 CURSOR_RIGHT success'); + commonEventPublishData = { + data: "SUCCESS" + }; + commoneventmanager.publish("inputMethodAbility_test_048", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodAbility_test_049(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_049 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_049", commonEventPublishData, this.publishCallback); + } else { + try { + KeyboardDelegate.hide((err, value) => { + if (err) { + console.debug(TAG + '====>inputMethodAbility_test_049 hide err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + commonEventPublishData = { + data: "SUCCESS" + }; + } + commoneventmanager.publish("inputMethodAbility_test_049", commonEventPublishData, this.publishCallback); + }); + } catch (err) { + commonEventPublishData = { + data: "FAILED" + }; + console.debug(TAG + '====>inputMethodAbility_test_049 hide throw_err:'); + commoneventmanager.publish("inputMethodAbility_test_040", commonEventPublishData, this.publishCallback); + } + } + }); + } + + private inputMethodAbility_test_050(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_050 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_050", commonEventPublishData, this.publishCallback); + } else { + try { + await KeyboardDelegate.hide(); + console.debug(TAG + '====>inputMethodAbility_test_050 hideKeyboard success'); + commonEventPublishData = { + data: "SUCCESS" + }; + } catch (err) { + commonEventPublishData = { + data: "FAILED" + }; + console.debug(TAG + '====>inputMethodAbility_test_050 hideKeyboard catch err:' + JSON.stringify(err)); + } + commoneventmanager.publish("inputMethodAbility_test_050", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodAbility_test_101(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_101 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + let range = { start: 0, end: 1 }; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_101", commonEventPublishData, this.publishCallback); + } else { + try { + InputClient.selectByRange(range, (err, value) => { + if (err) { + console.debug(TAG + '====>inputMethodAbility_test_101 selectByRange err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + commonEventPublishData = { + data: "SUCCESS" + }; + } + commoneventmanager.publish("inputMethodAbility_test_101", commonEventPublishData, this.publishCallback); + }); + } catch (err) { + commonEventPublishData = { + data: "FAILED" + }; + console.debug(TAG + '====>inputMethodAbility_test_101 selectByRange throw_err:'); + commoneventmanager.publish("inputMethodAbility_test_101", commonEventPublishData, this.publishCallback); + } + } + }); + } + + private inputMethodAbility_test_102(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_102 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + let range = { start: 0, end: 1 }; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_102", commonEventPublishData, this.publishCallback); + } else { + try { + await InputClient.selectByRange(range); + console.debug(TAG + '====>inputMethodAbility_test_102 selectByRange success'); + commonEventPublishData = { + data: "SUCCESS" + }; + } catch (err) { + commonEventPublishData = { + data: "FAILED" + }; + console.debug(TAG + '====>inputMethodAbility_test_102 selectByRange catch err:' + JSON.stringify(err)); + } + commoneventmanager.publish("inputMethodAbility_test_102", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodAbility_test_103(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_103 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_103", commonEventPublishData, this.publishCallback); + } else { + try { + InputClient.getTextIndexAtCursor((err, value) => { + if (err) { + console.debug(TAG + '====>inputMethodAbility_test_103 getTextIndexAtCursor err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodAbility_test_103 getTextIndexAtCursor success' + JSON.stringify(value)); + if (typeof value === 'number') { + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + } + commoneventmanager.publish("inputMethodAbility_test_103", commonEventPublishData, this.publishCallback); + }); + } catch (err) { + commonEventPublishData = { + data: "FAILED" + }; + console.debug(TAG + '====>inputMethodAbility_test_103 getTextIndexAtCursor throw_err:'); + commoneventmanager.publish("inputMethodAbility_test_103", commonEventPublishData, this.publishCallback); + } + } + }); + } + + private inputMethodAbility_test_104(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_104 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_104", commonEventPublishData, this.publishCallback); + } else { + try { + let value = await InputClient.getTextIndexAtCursor(); + console.debug(TAG + '====>inputMethodAbility_test_104 getTextIndexAtCursor value:' + JSON.stringify(value)); + if (typeof value === 'number') { + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + } catch (err) { + commonEventPublishData = { + data: "FAILED" + }; + console.debug(TAG + '====>inputMethodAbility_test_104 getTextIndexAtCursor catch err:'); + } + commoneventmanager.publish("inputMethodAbility_test_104", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodAbility_test_105(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_105 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + let movement = { direction: inputMethodEngine.CURSOR_DOWN }; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_105", commonEventPublishData, this.publishCallback); + } else { + try { + InputClient.selectByMovement(movement, (err, value) => { + if (err) { + console.debug(TAG + '====>inputMethodAbility_test_105 selectByMovement err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodAbility_test_105 selectByMovement success'); + commonEventPublishData = { + data: "SUCCESS" + }; + } + commoneventmanager.publish("inputMethodAbility_test_105", commonEventPublishData, this.publishCallback); + }); + } catch (err) { + commonEventPublishData = { + data: "FAILED" + }; + console.debug(TAG + '====>inputMethodAbility_test_105 selectByMovement throw_err:'); + commoneventmanager.publish("inputMethodAbility_test_105", commonEventPublishData, this.publishCallback); + } + } + }); + } + + private inputMethodAbility_test_106(): void { + console.debug(TAG + '====>receive inputMethodAbility_test_106 data'); + inputMethodAbility.on('inputStart', async (KeyboardDelegate, InputClient) => { + inputMethodAbility.off('inputStart'); + let commonEventPublishData; + let movement = { direction: inputMethodEngine.CURSOR_RIGHT }; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodAbility_test_106", commonEventPublishData, this.publishCallback); + } else { + try { + let value = await InputClient.selectByMovement(movement); + console.debug(TAG + '====>inputMethodAbility_test_106 selectByMovement success'); + commonEventPublishData = { + data: "SUCCESS" + }; + } catch (err) { + commonEventPublishData = { + data: "FAILED" + }; + console.debug(TAG + '====>inputMethodAbility_test_106 getTextIndexAtCursor catch err:'); + } + commoneventmanager.publish("inputMethodAbility_test_106", commonEventPublishData, this.publishCallback); + } + }); + } +} \ No newline at end of file diff --git a/inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodEngine/InputDemoService.ts b/inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodEngine/InputDemoService.ts new file mode 100644 index 0000000000000000000000000000000000000000..b309c8521245d41d0fcaf0e03429b3c7b8cab436 --- /dev/null +++ b/inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodEngine/InputDemoService.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import InputMethodExtensionAbility from '@ohos.InputMethodExtensionAbility'; +import { KeyboardController } from './KeyboardController'; + +export default class InputDemoService extends InputMethodExtensionAbility { + private keyboardController: KeyboardController; + + onCreate(want) { + this.keyboardController = new KeyboardController(this.context); + this.keyboardController.onCreate(); // 初始化窗口 + } + + onDestroy() { + console.log("onDestroy inputMethodEngine**"); + this.context.destroy(); + } +} \ No newline at end of file diff --git a/inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodEngine/KeyboardController.ts b/inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodEngine/KeyboardController.ts new file mode 100644 index 0000000000000000000000000000000000000000..2529cf2ca4adc950abc6d8f52e023060097371a4 --- /dev/null +++ b/inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodEngine/KeyboardController.ts @@ -0,0 +1,770 @@ +import prompt from '@ohos.prompt'; +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import inputmethodengine from '@ohos.inputMethodEngine'; +import display from '@ohos.display'; +import windowManager from '@ohos.window'; +import commoneventmanager from '@ohos.commonEventManager'; + + +let inputMethodEngine = inputmethodengine.getInputMethodEngine(); +let inputKeyboardDelegate = inputmethodengine.createKeyboardDelegate(); +const TAG = "keyboardController"; + +export class KeyboardController { + mContext; + WINDOW_TYPE_INPUT_METHOD_FLOAT = 2105; + windowName = 'inputApp'; + private windowHeight: number = 0; + private windowWidth: number = 0; + private nonBarPosition: number = 0; + + constructor(context) { + this.mContext = context; + } + + public onCreate(): void { + this.initWindow(); + let that = this; + + function subscriberCallback(err, data) { + console.debug(TAG + '====>receive event err: ' + JSON.stringify(err)); + console.debug(TAG + '====>receive event data ' + JSON.stringify(data)); + switch (data.code) { + case 1: + console.debug(TAG + '====>inputMethodEngine_test_getInputMethodEngine_001 event:' + data.event); + that.inputMethodEngine_test_getInputMethodEngine_001(); + break; + case 2: + console.debug(TAG + '====>inputMethodEngine_test_getKeyboardDelegate_001 event:' + data.event); + that.inputMethodEngine_test_getKeyboardDelegate_001(); + break; + case 28: + console.debug(TAG + '====>inputMethodEngine_test_028 event:' + data.event); + that.inputMethodEngine_test_028(); + break; + case 29: + console.debug(TAG + '====>inputMethodEngine_test_029 event:' + data.event); + that.inputMethodEngine_test_029(); + break; + case 30: + console.debug(TAG + '====>inputMethodEngine_test_030 event:' + data.event); + that.inputMethodEngine_test_030(); + break; + case 31: + console.debug(TAG + '====>inputMethodEngine_test_031 event:' + data.event); + that.inputMethodEngine_test_031(); + break; + case 32: + console.debug(TAG + '====>inputMethodEngine_test_032 event:' + data.event); + that.inputMethodEngine_test_032(); + break; + case 33: + console.debug(TAG + '====>inputMethodEngine_test_033 event:' + data.event); + that.inputMethodEngine_test_033(); + break; + case 34: + console.debug(TAG + '====>inputMethodEngine_test_034 event:' + data.event); + that.inputMethodEngine_test_034(); + break; + case 35: + console.debug(TAG + '====>inputMethodEngine_test_035 event:' + data.event); + that.inputMethodEngine_test_035(); + break; + case 36: + console.debug(TAG + '====>inputMethodEngine_test_036 event:' + data.event); + that.inputMethodEngine_test_036(); + break; + case 37: + console.debug(TAG + '====>inputMethodEngine_test_037 event:' + data.event); + that.inputMethodEngine_test_037(); + break; + case 38: + console.debug(TAG + '====>inputMethodEngine_test_038 event:' + data.event); + that.inputMethodEngine_test_038(); + break; + case 39: + console.debug(TAG + '====>inputMethodEngine_test_039 event:' + data.event); + that.inputMethodEngine_test_039(); + break; + case 40: + console.debug(TAG + '====>inputMethodEngine_test_040 event:' + data.event); + that.inputMethodEngine_test_040(); + break; + case 41: + console.debug(TAG + '====>inputMethodEngine_test_041 event:' + data.event); + that.inputMethodEngine_test_041(); + break; + case 42: + console.debug(TAG + '====>inputMethodEngine_test_042 event:' + data.event); + that.inputMethodEngine_test_042(); + break; + case 43: + console.debug(TAG + '====>inputMethodEngine_test_043 event:' + data.event); + that.inputMethodEngine_test_043(); + break; + case 49: + console.debug(TAG + '====>inputMethodEngine_test_049 event:' + data.event); + that.inputMethodEngine_test_049(); + break; + case 50: + console.debug(TAG + '====>inputMethodEngine_test_050 event:' + data.event); + that.inputMethodEngine_test_050(); + break; + } + } + + var commonEventSubscribeInfo = { + events: ["test1"] + }; + + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then(function (data) { + subscriber = data; + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug(TAG + '====>scene subscribe finish===='); + }); + } + + public onDestroy(): void { + console.log('imsakitjsapp onDestroy'); + globalThis.textInputClient.getTextIndexAtCursor().then((index) => { + console.log('imsakitjsapp getTextIndexAtCursor: index = ' + index); + prompt.showToast({ message: 'getTextIndexAtCursor success' + index, duration: 200, bottom: 500 }); + var win = windowManager.findWindow(this.windowName); + win.destroyWindow(); + this.mContext.terminateSelf(); + return true; + }).catch((err) => { + prompt.showToast({ message: 'getTextIndexAtCursor failed', duration: 200, bottom: 500 }); + }); + } + + private initWindow(): void { + display.getDefaultDisplay().then(dis => { + var dWidth = dis.width; + var dHeight = dis.height; + var keyHeightRate = 0.47; + var keyHeight = dHeight * keyHeightRate; + this.windowWidth = dWidth; + this.windowHeight = keyHeight; + this.nonBarPosition = dHeight - keyHeight; + + var config = { + name: this.windowName, + windowType: this.WINDOW_TYPE_INPUT_METHOD_FLOAT, + ctx: this.mContext + }; + windowManager.createWindow(config).then((win) => { + win.resize(dWidth, keyHeight).then(() => { + win.moveWindowTo(0, this.nonBarPosition).then(() => { + win.setUIContent('pages/service/index').then(() => { + }); + }); + }); + }); + }); + } + + private publishCallback(err): void { + if (err) { + console.error(TAG + '====>publish failed: ' + JSON.stringify(err)); + } else { + console.log(TAG + '====>publish'); + } + } + + private inputMethodEngine_test_getInputMethodEngine_001(): void { + console.debug(TAG + '====>receive inputMethodEngine_test_getInputMethodEngine_001 data'); + if (typeof(inputMethodEngine) === "object") { + console.info(TAG + '====>receive inputMethodEngine_test_getInputMethodEngine_001 object'); + var commonEventPublishData = { + data: "SUCCESS" + }; + } else { + console.info(TAG + '====>receive inputMethodEngine_test_getInputMethodEngine_001 failed'); + var commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodEngine_test_getInputMethodEngine_001", commonEventPublishData, this.publishCallback); + } + + private inputMethodEngine_test_getKeyboardDelegate_001(): void { + console.debug(TAG + '====>receive inputMethodEngine_test_getKeyboardDelegate_001 data'); + if (typeof(inputKeyboardDelegate) === "object") { + console.info(TAG + '====>receive inputMethodEngine_test_getKeyboardDelegate_001 object'); + var commonEventPublishData = { + data: "SUCCESS" + }; + } else { + console.info(TAG + '====>receive inputMethodEngine_test_getKeyboardDelegate_001 failed'); + var commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodEngine_test_getKeyboardDelegate_001", commonEventPublishData, this.publishCallback); + } + + private inputMethodEngine_test_028(): void { + console.debug(TAG + '====>receive inputMethodEngine_test_028 data'); + inputMethodEngine.on('inputStart', async (keyboardController, TextInputClient) => { + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (TextInputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_028", commonEventPublishData, this.publishCallback); + } else { + let editorAttribyte = await TextInputClient.getEditorAttribute(); + console.debug(TAG + '====>receive inputMethodEngine_test_028 editorAttribyte: ' + JSON.stringify(editorAttribyte)); + TextInputClient.sendKeyFunction(editorAttribyte.enterKeyType, (err, value) => { + if (err) { + commonEventPublishData = { + data: "FAILED" + }; + console.debug(TAG + '====>inputMethodEngine_test_028 TextInputClient sendKeyFunction err: ' + JSON.stringify(err)); + } else { + console.debug(TAG + '====>inputMethodEngine_test_028 TextInputClient sendKeyFunction value: ' + JSON.stringify(value)); + if (value) { + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + + } + commoneventmanager.publish("inputMethodEngine_test_028", commonEventPublishData, this.publishCallback); + }); + } + }); + } + private inputMethodEngine_test_029(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_029 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_029", commonEventPublishData, this.publishCallback); + } else { + let editorAttribyte = await InputClient.getEditorAttribute(); + console.debug(TAG + '====>inputMethodEngine_test_029 editorAttribyte:' + JSON.stringify(editorAttribyte)); + let value = await InputClient.sendKeyFunction(editorAttribyte.enterKeyType); + console.debug(TAG + '====>inputMethodEngine_test_029 sendKeyFunction:' + JSON.stringify(value)); + if (value){ + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodEngine_test_029", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodEngine_test_030(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_030 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_030", commonEventPublishData, this.publishCallback); + } else { + InputClient.deleteForward(1, (err, value) => { + if (err){ + console.debug(TAG + '====>inputMethodEngine_test_030 deleteForward err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodEngine_test_030 deleteForward value:' + JSON.stringify(value)); + if (typeof(value) === 'boolean'){ + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + } + commoneventmanager.publish("inputMethodEngine_test_030", commonEventPublishData, this.publishCallback); + }); + } + }); + } + private inputMethodEngine_test_031(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_031 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_031", commonEventPublishData, this.publishCallback); + } else { + let value = await InputClient.deleteForward(1); + console.debug(TAG + '====>inputMethodEngine_test_031 deleteForward:' + JSON.stringify(value)); + if (typeof(value) === 'boolean'){ + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodEngine_test_031", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodEngine_test_032(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_032 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_032", commonEventPublishData, this.publishCallback); + } else { + InputClient.deleteBackward(1, (err, value) => { + if (err){ + console.debug(TAG + '====>inputMethodEngine_test_032 deleteBackward err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodEngine_test_032 deleteBackward value:' + JSON.stringify(value)); + if (value){ + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + } + commoneventmanager.publish("inputMethodEngine_test_032", commonEventPublishData, this.publishCallback); + }); + } + }); + } + private inputMethodEngine_test_033(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_033 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_033", commonEventPublishData, this.publishCallback); + } else { + let value = await InputClient.deleteBackward(1); + console.debug(TAG + '====>inputMethodEngine_test_033 deleteBackward:' + JSON.stringify(value)); + if (value){ + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodEngine_test_033", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodEngine_test_034(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_034 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_034", commonEventPublishData, this.publishCallback); + } else { + InputClient.insertText('test', (err, value) => { + if (err){ + console.debug(TAG + '====>inputMethodEngine_test_034 insertText err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodEngine_test_034 insertText value:' + JSON.stringify(value)); + if (value){ + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + } + commoneventmanager.publish("inputMethodEngine_test_034", commonEventPublishData, this.publishCallback); + }); + } + }); + } + private inputMethodEngine_test_035(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_035 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_035", commonEventPublishData, this.publishCallback); + } else { + let value = await InputClient.insertText('test'); + console.debug(TAG + '====>inputMethodEngine_test_035 insertText:' + JSON.stringify(value)); + if (value){ + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodEngine_test_035", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodEngine_test_036(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_036 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_036", commonEventPublishData, this.publishCallback); + } else { + InputClient.getForward(1, (err, value) => { + if (err){ + console.debug(TAG + '====>inputMethodEngine_test_036 getForward err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodEngine_test_036 getForward value:' + JSON.stringify(value)); + if (value){ + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + } + commoneventmanager.publish("inputMethodEngine_test_036", commonEventPublishData, this.publishCallback); + }); + } + }); + } + private inputMethodEngine_test_037(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_037 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_037", commonEventPublishData, this.publishCallback); + } else { + let value = await InputClient.getForward(1); + console.debug(TAG + '====>inputMethodEngine_test_037 getForward:' + JSON.stringify(value)); + if (value){ + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodEngine_test_037", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodEngine_test_038(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_038 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_038", commonEventPublishData, this.publishCallback); + } else { + InputClient.getEditorAttribute((err, value) => { + if (err){ + console.debug(TAG + '====>inputMethodEngine_test_038 getEditorAttribute err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodEngine_test_038 getEditorAttribute value:' + JSON.stringify(value)); + if (value){ + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + } + commoneventmanager.publish("inputMethodEngine_test_038", commonEventPublishData, this.publishCallback); + }); + } + }); + } + private inputMethodEngine_test_039(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_039 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_039", commonEventPublishData, this.publishCallback); + } else { + let value = await InputClient.getEditorAttribute(); + console.debug(TAG + '====>inputMethodEngine_test_039 getEditorAttribute:' + JSON.stringify(value)); + if (value){ + commonEventPublishData = { + data: "SUCCESS" + }; + } else { + commonEventPublishData = { + data: "FAILED" + }; + } + commoneventmanager.publish("inputMethodEngine_test_039", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodEngine_test_040(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_040 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_040", commonEventPublishData, this.publishCallback); + } else { + try{ + KeyboardDelegate.hideKeyboard((err, value) => { + if (err){ + console.debug(TAG + '====>inputMethodEngine_test_040 hideKeyboard:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + commonEventPublishData = { + data: "SUCCESS" + }; + } + commoneventmanager.publish("inputMethodEngine_test_040", commonEventPublishData, this.publishCallback); + }); + }catch(err){ + commonEventPublishData = { + data: "FAILED" + }; + console.debug(TAG + '====>inputMethodEngine_test_040 hideKeyboard throw_err:'); + commoneventmanager.publish("inputMethodEngine_test_040", commonEventPublishData, this.publishCallback); + } + } + }); + } + private inputMethodEngine_test_041(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_041 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_041", commonEventPublishData, this.publishCallback); + } else { + try{ + await KeyboardDelegate.hideKeyboard(); + console.debug(TAG + '====>inputMethodEngine_test_041 hideKeyboard success'); + commonEventPublishData = { + data: "SUCCESS" + }; + }catch(err){ + commonEventPublishData = { + data: "FAILED" + }; + console.debug(TAG + '====>inputMethodEngine_test_041 hideKeyboard catch err:'); + } + commoneventmanager.publish("inputMethodEngine_test_041", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodEngine_test_042(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_042 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_042", commonEventPublishData, this.publishCallback); + } else { + InputClient.getBackward(1, (err, value) => { + if (err){ + console.debug(TAG + '====>inputMethodEngine_test_042 getBackward err:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + console.debug(TAG + '====>inputMethodEngine_test_042 getBackward value:' + JSON.stringify(value)); + commonEventPublishData = { + data: "SUCCESS" + }; + } + commoneventmanager.publish("inputMethodEngine_test_042", commonEventPublishData, this.publishCallback); + }); + } + }); + } + private inputMethodEngine_test_043(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_043 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_043", commonEventPublishData, this.publishCallback); + } else { + let value = await InputClient.getBackward(1); + console.debug(TAG + '====>inputMethodEngine_test_043 getBackward:' + JSON.stringify(value)); + commonEventPublishData = { + data: "SUCCESS" + }; + commoneventmanager.publish("inputMethodEngine_test_043", commonEventPublishData, this.publishCallback); + } + }); + } + + private inputMethodEngine_test_049(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_049 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_049", commonEventPublishData, this.publishCallback); + } else { + try{ + KeyboardDelegate.hide((err, value) => { + if (err){ + console.debug(TAG + '====>inputMethodEngine_test_049 hide:' + JSON.stringify(err)); + commonEventPublishData = { + data: "FAILED" + }; + } else { + commonEventPublishData = { + data: "SUCCESS" + }; + } + commoneventmanager.publish("inputMethodEngine_test_049", commonEventPublishData, this.publishCallback); + }); + }catch(err){ + commonEventPublishData = { + data: "FAILED" + }; + console.debug(TAG + '====>inputMethodEngine_test_049 hide throw_err:'); + commoneventmanager.publish("inputMethodEngine_test_040", commonEventPublishData, this.publishCallback); + } + } + }); + } + private inputMethodEngine_test_050(): void{ + console.debug(TAG + '====>receive inputMethodEngine_test_050 data'); + inputMethodEngine.on('inputStart', async(KeyboardDelegate, InputClient) =>{ + inputMethodEngine.off('inputStart'); + let commonEventPublishData; + if (InputClient == null) { + commonEventPublishData = { + data: "FAILED" + }; + commoneventmanager.publish("inputMethodEngine_test_050", commonEventPublishData, this.publishCallback); + } else { + try{ + await KeyboardDelegate.hide(); + console.debug(TAG + '====>inputMethodEngine_test_050 hideKeyboard success'); + commonEventPublishData = { + data: "SUCCESS" + }; + }catch(err){ + commonEventPublishData = { + data: "FAILED" + }; + console.debug(TAG + '====>inputMethodEngine_test_050 hideKeyboard catch err:'); + } + commoneventmanager.publish("inputMethodEngine_test_050", commonEventPublishData, this.publishCallback); + } + }); + } + + + + +} \ No newline at end of file diff --git a/inputmethod/InputMethodEngine/entry/src/main/ets/MainAbility/MainAbility.ts b/inputmethod/InputMethodEngine/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..744c983f864fdf4008d347eaeb2fa7464dda4804 --- /dev/null +++ b/inputmethod/InputMethodEngine/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.app.ability.UIAbility'; + +export default class MainAbility extends Ability { + onCreate(want,launchParam){ + // Ability is creating, initialize resources for this ability + console.info("ImExtAbility onCreate"); + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.info("ImExtAbility onDestroy"); + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.info("ImExtAbility onWindowStageCreate"); + globalThis.abilityContext = this.context; + windowStage.setUIContent(this.context, "pages/index/index", null); + console.info("ImExtAbility onWindowStageCreate finish"); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.info("ImExtAbility onWindowStageDestroy"); + } + + onForeground() { + // Ability has brought to foreground + console.info("ImExtAbility onForeground"); + } + + onBackground() { + // Ability has back to background + console.info("ImExtAbility onBackground"); + } +}; \ No newline at end of file diff --git a/inputmethod/InputMethodEngine/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/inputmethod/InputMethodEngine/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..3075161ab78473ca562fe61a609af22225363596 --- /dev/null +++ b/inputmethod/InputMethodEngine/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import TestRunner from '@ohos.application.testRunner'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; + +var abilityDelegator = undefined; +var abilityDelegatorArguments = undefined; + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s it', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' + ]); + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${targetParams} ${key} ${parameters[key]}`; + } + } + return targetParams.trim(); +} + +async function onAbilityCreateCallback() { + console.log("onAbilityCreateCallback"); +} + +async function addAbilityMonitorCallback(err: any) { + console.info("addAbilityMonitorCallback : " + JSON.stringify(err)); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + console.info("OpenHarmonyTestRunner OnPrepare "); + } + + async onRun() { + console.log('OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility'; + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + var cmd = 'aa start -d 0 -a com.acts.inputmethodengine.test.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters); + var debug = abilityDelegatorArguments.parameters["-D"]; + if (debug === 'true') + { + cmd += ' -D'; + } + console.info('cmd : '+cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + console.info('executeShellCommand : err : ' + JSON.stringify(err)); + console.info('executeShellCommand : data : ' + d.stdResult); + console.info('executeShellCommand : data : ' + d.exitCode); + }); + console.info('OpenHarmonyTestRunner onRun end'); + } +}; \ No newline at end of file diff --git a/inputmethod/InputMethodEngine/entry/src/main/ets/pages/index/index.ets b/inputmethod/InputMethodEngine/entry/src/main/ets/pages/index/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..66e02652a8ec4e7245ab6ab75f899cfccb481058 --- /dev/null +++ b/inputmethod/InputMethodEngine/entry/src/main/ets/pages/index/index.ets @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../test/List.test' + +@Entry +@Component +struct Index { + @State message: string = 'Hello World'; + @State inputValue: string = 'inputMethodEngineinputMethodEngineinputMethodEngineinputMethodEngine' + + 'inputMethodEngineinputMethodEngineinputMethodEngineinputMethodEngineinputMethodEngine'; + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + .defaultFocus(true) + TextArea({ text: this.inputValue }) + .height(50) + .onChange((value: string) => { + this.inputValue = value; + }) + Button() { + Text('next page') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .width('35%') + .height('5%') + .onClick(() => { + }) + } + .width('100%') + } + .height('100%') + } + + aboutToAppear(){ + let abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + let abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + console.info('start run testcase!!!') + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/pages/index/index.ets b/inputmethod/InputMethodEngine/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 62% rename from ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/pages/index/index.ets rename to inputmethod/InputMethodEngine/entry/src/main/ets/pages/second/second.ets index 845ac99a65c818dddc9fdd0db462499ef02cdb11..f9009a3e8567d1f4557ebc11dded54c7e27c0b0d --- a/ability/ability_runtime/non_concurrent/actsthirdapponerelytest/entry/src/main/ets/pages/index/index.ets +++ b/inputmethod/InputMethodEngine/entry/src/main/ets/pages/second/second.ets @@ -14,25 +14,28 @@ */ import router from '@system.router'; -async function routePage() { - let options = { - uri: 'pages/second' - } - try { - await router.push(options) - } catch (err) { - console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`) - } -} - @Entry @Component -struct Index { +struct Second { + private content: string = "Second Page" + build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World') + Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) .fontSize(50) .fontWeight(FontWeight.Bold) + Button() { + Text('back to index') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) } .width('100%') .height('100%') diff --git a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/test/List.test.ets b/inputmethod/InputMethodEngine/entry/src/main/ets/test/List.test.ets old mode 100755 new mode 100644 similarity index 79% rename from ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/test/List.test.ets rename to inputmethod/InputMethodEngine/entry/src/main/ets/test/List.test.ets index 967e540db3afe80dc6dbabe06f1488f3ff34725a..3b1e0268fd24288686623f99503832c8721b2e5a --- a/ability/ability_runtime/non_concurrent/actsthirdappatest/entry/src/main/ets/test/List.test.ets +++ b/inputmethod/InputMethodEngine/entry/src/main/ets/test/List.test.ets @@ -1,19 +1,21 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import abilityPermissionText from './AbilityPermission.test.ets' - -export default function testsuite() { - abilityPermissionText() +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import inputMethodEngine from './inputMethodEngine.test' +import inputMethodAbility from './inputMethodAbility.test' + +export default function testsuite() { + inputMethodEngine(); + inputMethodAbility() } \ No newline at end of file diff --git a/inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodAbility.test.ets b/inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodAbility.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..fe62f91860322ff3cb38e8f7d2b46315ec352be6 --- /dev/null +++ b/inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodAbility.test.ets @@ -0,0 +1,1913 @@ +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" +import inputMethod from '@ohos.inputMethod'; +import inputMethodEngine from '@ohos.inputMethodEngine'; +import subtype from '@ohos.InputMethodSubtype'; +import commonEventManager from '@ohos.commonEventManager'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry' +import display from '@ohos.display'; + +export default function inputMethodAbility() { + describe('inputMethodAbility', function () { + var inputServer = { + packageName: '', + methodId: '', + name:'', + id:'', + extra:{} + } + + let display_info; + let getFocusCmd = ''; + let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + async function runCmd(cmd){ + console.debug('====>runCmd info:' + cmd); + await abilityDelegator.executeShellCommand(cmd); + } + beforeAll(async (done)=>{ + display_info = display.getDefaultDisplaySync() + getFocusCmd = `uinput -T -c ${display_info.width*0.5} ${display_info.height*0.5}` + let inputM = inputMethod.getCurrentInputMethod() + console.info("====>beforeAll: switchInputMethod to: " + JSON.stringify(inputM)); + inputServer.packageName = inputM.packageName; + inputServer.methodId = inputM.methodId; + inputServer.name = inputM.packageName; + inputServer.id = inputM.methodId; + console.info("====>beforeAll inputMethodStageJSUnit start"); + let inputDemoService: subtype ={ + id: 'com.acts.inputmethodengine.test', + label: 'inputStageService', + name: '', + mode: 'lower', + locale: '', + language: '', + icon: '', + iconId: 0, + extra: {}, + } + try{ + await inputMethod.switchCurrentInputMethodSubtype(inputDemoService); + setTimeout(()=>{ + console.debug("====>beforeAll inputMethodStageJSUnit switchCurrentInputMethodSubtype success"); + done(); + },2000) + }catch(err){ + console.debug("====>beforeAll inputMethodStageJSUnit switchCurrentInputMethodSubtype failed"); + } + }) + + it('inputMethodEngine_test_001', 0, async function (done) { + let keyType = inputMethodEngine.ENTER_KEY_TYPE_UNSPECIFIED; + console.info("====>inputMethodEngine_test_001 result:" + keyType); + expect(keyType).assertEqual(0); + done(); + }); + + it('inputMethodEngine_test_002', 0, async function (done) { + let keyType = inputMethodEngine.ENTER_KEY_TYPE_GO; + console.info("====>inputMethodEngine_test_002 result:" + keyType); + expect(keyType).assertEqual(2); + done(); + }); + + it('inputMethodEngine_test_003', 0, async function (done) { + let keyType = inputMethodEngine.ENTER_KEY_TYPE_SEARCH; + console.info("====>inputMethodEngine_test_003 result:" + keyType); + expect(keyType).assertEqual(3); + done(); + }); + + it('inputMethodEngine_test_004', 0, async function (done) { + let keyType = inputMethodEngine.ENTER_KEY_TYPE_SEND; + console.info("====>inputMethodEngine_test_004 result:" + keyType); + expect(keyType).assertEqual(4); + done(); + }); + + it('inputMethodEngine_test_005', 0, async function (done) { + let keyType = inputMethodEngine.ENTER_KEY_TYPE_NEXT; + console.info("====>inputMethodEngine_test_005 result:" + keyType); + expect(keyType).assertEqual(5); + done(); + }); + + it('inputMethodEngine_test_006', 0, async function (done) { + let keyType = inputMethodEngine.ENTER_KEY_TYPE_DONE; + console.info("====>inputMethodEngine_test_006 result:" + keyType); + expect(keyType).assertEqual(6); + done(); + }); + + it('inputMethodEngine_test_007', 0, async function (done) { + let keyType = inputMethodEngine.ENTER_KEY_TYPE_PREVIOUS; + console.info("====>inputMethodEngine_test_007 result:" + keyType); + expect(keyType).assertEqual(7); + done(); + }); + + it('inputMethodEngine_test_008', 0, async function (done) { + let keyType = inputMethodEngine.PATTERN_NULL; + console.info("====>inputMethodEngine_test_008 result:" + keyType); + expect(keyType).assertEqual(-1); + done(); + }); + + it('inputMethodEngine_test_009', 0, async function (done) { + let keyType = inputMethodEngine.PATTERN_TEXT; + console.info("====>inputMethodEngine_test_009 result:" + keyType); + expect(keyType).assertEqual(0); + done(); + }); + + it('inputMethodEngine_test_010', 0, async function (done) { + let keyType = inputMethodEngine.PATTERN_NUMBER; + console.info("====>inputMethodEngine_test_010 result:" + keyType); + expect(keyType).assertEqual(2); + done(); + }); + + it('inputMethodEngine_test_011', 0, async function (done) { + let keyType = inputMethodEngine.PATTERN_PHONE; + console.info("====>inputMethodEngine_test_011 result:" + keyType); + expect(keyType).assertEqual(3); + done(); + }); + + it('inputMethodEngine_test_012', 0, async function (done) { + let keyType = inputMethodEngine.PATTERN_DATETIME; + console.info("====>inputMethodEngine_test_012 result:" + keyType); + expect(keyType).assertEqual(4); + done(); + }); + + it('inputMethodEngine_test_013', 0, async function (done) { + let keyType = inputMethodEngine.PATTERN_EMAIL; + console.info("====>inputMethodEngine_test_013 result:" + keyType); + expect(keyType).assertEqual(5); + done(); + }); + + it('inputMethodEngine_test_014', 0, async function (done) { + let keyType = inputMethodEngine.PATTERN_URI; + console.info("====>inputMethodEngine_test_014 result:" + keyType); + expect(keyType).assertEqual(6); + done(); + }); + + it('inputMethodEngine_test_015', 0, async function (done) { + let keyType = inputMethodEngine.PATTERN_PASSWORD; + console.info("====>inputMethodEngine_test_015 result:" + keyType); + expect(keyType).assertEqual(7); + done(); + }); + + it('inputMethodEngine_test_016', 0, async function (done) { + let keyType = inputMethodEngine.FLAG_SELECTING; + console.info("====>inputMethodEngine_test_016 result:" + keyType); + expect(keyType).assertEqual(2); + done(); + }); + + it('inputMethodEngine_test_017', 0, async function (done) { + let keyType = inputMethodEngine.FLAG_SINGLE_LINE; + console.info("====>inputMethodEngine_test_017 result:" + keyType); + expect(keyType).assertEqual(1); + done(); + }); + + it('inputMethodEngine_test_018', 0, async function (done) { + let keyType = inputMethodEngine.DISPLAY_MODE_PART; + console.info("====>inputMethodEngine_test_018 result:" + keyType); + expect(keyType).assertEqual(0); + done(); + }); + + it('inputMethodEngine_test_019', 0, async function (done) { + let keyType = inputMethodEngine.DISPLAY_MODE_FULL; + console.info("====>inputMethodEngine_test_019 result:" + keyType); + expect(keyType).assertEqual(1); + done(); + }); + + it('inputMethodEngine_test_020', 0, async function (done) { + let keyType = inputMethodEngine.OPTION_ASCII; + console.info("====>inputMethodEngine_test_020 result:" + keyType); + expect(keyType).assertEqual(20); + done(); + }); + + it('inputMethodEngine_test_021', 0, async function (done) { + let keyType = inputMethodEngine.OPTION_NONE; + console.info("====>inputMethodEngine_test_021 result:" + keyType); + expect(keyType).assertEqual(0); + done(); + }); + + it('inputMethodEngine_test_022', 0, async function (done) { + let keyType = inputMethodEngine.OPTION_AUTO_CAP_CHARACTERS; + console.info("====>inputMethodEngine_test_022 result:" + keyType); + expect(keyType).assertEqual(2); + done(); + }); + + it('inputMethodEngine_test_023', 0, async function (done) { + let keyType = inputMethodEngine.OPTION_AUTO_CAP_SENTENCES; + console.info("====>inputMethodEngine_test_023 result:" + keyType); + expect(keyType).assertEqual(8); + done(); + }); + + it('inputMethodEngine_test_024', 0, async function (done) { + let keyType = inputMethodEngine.OPTION_AUTO_WORDS; + console.info("====>inputMethodEngine_test_024 result:" + keyType); + expect(keyType).assertEqual(4); + done(); + }); + + it('inputMethodEngine_test_025', 0, async function (done) { + let keyType = inputMethodEngine.OPTION_MULTI_LINE; + console.info("====>inputMethodEngine_test_025 result:" + keyType); + expect(keyType).assertEqual(1); + done(); + }); + + it('inputMethodEngine_test_026', 0, async function (done) { + let keyType = inputMethodEngine.OPTION_NO_FULLSCREEN; + console.info("====>inputMethodEngine_test_026 result:" + keyType); + expect(keyType).assertEqual(10); + done(); + }); + + it('inputMethodAbility_test_getInputMethodAbility_001', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_getInputMethodAbility_001 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_getInputMethodAbility_001 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_getInputMethodAbility_001 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_getInputMethodAbility_001 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_getInputMethodAbility_001 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_getInputMethodAbility_001 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_getInputMethodAbility_001 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_getInputMethodAbility_001 publishCallback failed:" + + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_getInputMethodAbility_001"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_getInputMethodAbility_001 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_getInputMethodAbility_001 subscriber finish"); + }) + + var commonEventPublishData = { + code: 1 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_getKeyboardDelegate_001', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_getKeyboardDelegate_001 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_getKeyboardDelegate_001 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_getKeyboardDelegate_001 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_getKeyboardDelegate_001 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_getKeyboardDelegate_001 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_getKeyboardDelegate_001 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_getKeyboardDelegate_001 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_getKeyboardDelegate_001 publishCallback failed:" + + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_getKeyboardDelegate_001"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_getKeyboardDelegate_001 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_getKeyboardDelegate_001 subscriber finish"); + }) + + var commonEventPublishData = { + code: 2 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_028', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_028 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_028 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_028 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_028 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_028 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_028 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_028 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_028 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_028"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_028 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_028 subscriber finish"); + }) + + var commonEventPublishData = { + code: 28 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_029', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_029 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_029 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_029 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_029 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_029 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_029 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_029 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_029 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_029"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_029 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_029 subscriber finish"); + }) + + var commonEventPublishData = { + code: 29 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback) + }); + + it('inputMethodAbility_test_030', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_030 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_030 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_030 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_030 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_030 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_030 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_030 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_030 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_030"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_030 subscriber data:" + JSON.stringify(data)) + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_030 subscriber finish"); + }) + + var commonEventPublishData = { + code: 30 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_031', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_031 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_031 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_031 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_031 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_031 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_031 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_031 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_031 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_031"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_031 subscriber data:" + JSON.stringify(data)) + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_031 subscriber finish"); + }) + + var commonEventPublishData = { + code: 31 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_032', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_032 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_032 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_032 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_032 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_032 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_032 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_032 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_032 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_032"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_032 subscriber data:" + JSON.stringify(data)) + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_032 subscriber finish"); + }) + + var commonEventPublishData = { + code: 32 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_033', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_033 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_033 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_033 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_033 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_033 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_033 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_033 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_033 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_033"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_033 subscriber data:" + JSON.stringify(data)) + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_033 subscriber finish"); + }) + + var commonEventPublishData = { + code: 33 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback) + }); + + it('inputMethodAbility_test_034', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_034 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_034 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_034 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_034 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_034 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_034 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_034 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_034 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_034"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_034 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_034 subscriber finish"); + }) + + var commonEventPublishData = { + code: 34 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_035', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_035 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_035 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_035 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_035 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_035 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_035 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_035 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_035 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_035"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_035 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_035 subscriber finish"); + }) + + var commonEventPublishData = { + code: 35 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_036', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_036 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_036 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_036 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_036 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_036 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_036 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_036 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_036 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_036"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_036 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_036 subscriber finish"); + }) + + var commonEventPublishData = { + code: 36 + }; + commonEventManager.publish('test', commonEventPublishData, publishCallback);; + }); + + it('inputMethodAbility_test_037', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_037 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_037 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_037 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_037 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_037 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_037 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_037 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_037 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_037"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_037 subscriber data:" + JSON.stringify(data)) + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_037 subscriber finish"); + }) + + var commonEventPublishData = { + code: 37 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_038', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_038 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_038 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_038 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_038 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_038 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_038 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_038 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_038 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_038"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_038 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_038 subscriber finish"); + }) + + var commonEventPublishData = { + code: 38 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_039', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_039 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_039 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_039 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_039 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_039 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_039 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_039 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_039 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_039"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_039 subscriber data:" + JSON.stringify(data)) + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_039 subscriber finish"); + }) + + var commonEventPublishData = { + code: 39 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_040', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_040 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_040 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_040 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_040 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_040 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_040 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_040 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_040 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_040"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_040 subscriber data:" + JSON.stringify(data)) + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_040 subscriber finish"); + }) + + var commonEventPublishData = { + code: 40 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_041', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_041 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_041 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_041 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_041 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_041 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_041 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_041 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_041 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_041"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_041 subscriber data:" + JSON.stringify(data)) + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_041 subscriber finish"); + }) + + var commonEventPublishData = { + code: 41 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_042', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_042 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_042 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_042 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_042 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_042 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_042 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_042 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_042 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_042"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_042 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_042 subscriber finish"); + }) + + var commonEventPublishData = { + code: 42 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_043', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_043 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_043 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_043 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_043 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_043 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_043 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_043 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_043 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_043"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_043 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_043 subscriber finish"); + }) + + var commonEventPublishData = { + code: 43 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_044', 0, async function (done) { + let keyType = inputMethodEngine.WINDOW_TYPE_INPUT_METHOD_FLOAT; + console.info("====>inputMethodEngine_test_044 result:" + keyType); + expect(keyType).assertEqual(2105); + done(); + }); + + it('inputMethodAbility_test_045', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_045 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_045 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_045 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_045 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_045 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_045 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_045 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_045 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_045"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_045 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_045 subscriber finish"); + }) + + var commonEventPublishData = { + code: 45 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_046', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_046 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_046 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_046 unSubscriberCallback finish") + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_046 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_046 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_046 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_046 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_046 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_046"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_046 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_046 subscriber finish"); + }) + + var commonEventPublishData = { + code: 46 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_047', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_047 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_047 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_047 unSubscriberCallback finish") + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_047 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_047 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_047 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_047 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_047 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_047"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_047 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_047 subscriber finish"); + }) + + var commonEventPublishData = { + code: 47 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_048', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_048 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_048 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_048 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_048 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_048 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_048 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_048 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_048 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_048"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_048 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_048 subscriber finish"); + }) + + var commonEventPublishData = { + code: 48 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_049', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_049 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_049 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_049 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_049 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_049 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_049 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_049 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_049 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_049"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_049 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_049 subscriber finish"); + }) + + var commonEventPublishData = { + code: 49 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_050', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_050 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_050 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_050 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_050 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_050 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_050 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_050 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_050 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_050"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_050 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_050 subscriber finish") + }) + + var commonEventPublishData = { + code: 50 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_101', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_101 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_101 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_101 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_101 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_101 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_101 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_101 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_101 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_101"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_101 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_101 subscriber finish"); + }) + + var commonEventPublishData = { + code: 101 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_102', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_102 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_102 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_102 unSubscriberCallback finish") + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_102 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_102 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_102 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_102 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_102 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_102"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_102 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_102 subscriber finish"); + }) + + var commonEventPublishData = { + code: 102 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_103', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_103 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_103 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_103 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_103 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_103 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_103 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_103 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_103 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_103"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_103 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_103 subscriber finish"); + }) + + var commonEventPublishData = { + code: 103 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_104', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_104 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_104 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_104 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_104 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_104 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_104 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_104 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_104 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_104"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_104 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_104 subscriber finish"); + }) + + var commonEventPublishData = { + code: 104 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_105', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_105 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_105 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_105 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_105 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_105 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_105 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_105 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_105 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_105"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_105 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_105 subscriber finish"); + }) + + var commonEventPublishData = { + code: 105 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + + it('inputMethodAbility_test_106', 0, async function (done) { + function unSubscriberCallback (err){ + console.info("====>inputMethodAbility_test_106 unSubscriberCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_106 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.info("====>inputMethodAbility_test_106 unSubscriberCallback finish"); + } + } + + function subscriberCallback (err, data){ + console.info("====>inputMethodAbility_test_106 subscriberCallback data:" + + JSON.stringify(data)); + commonEventManager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try{ + expect(data.data).assertEqual("SUCCESS"); + console.info("====>inputMethodAbility_test_106 end"); + clearTimeout(t); + done(); + }catch(err){ + console.info("====>inputMethodAbility_test_106 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err){ + console.info("====>inputMethodAbility_test_106 publishCallback start"); + if (err){ + console.info("====>inputMethodAbility_test_106 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodAbility_test_106"] + } + var subscriber; + commonEventManager.createSubscriber(commonEventSubscribeInfo).then((data)=>{ + subscriber = data; + console.info("====>inputMethodAbility_test_106 subscriber data:" + JSON.stringify(data)); + commonEventManager.subscribe(subscriber, subscriberCallback); + console.info("====>inputMethodAbility_test_106 subscriber finish"); + }) + + var commonEventPublishData = { + code: 106 + } + commonEventManager.publish('test', commonEventPublishData, publishCallback); + }); + }); +}; diff --git a/inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodEngine.test.ets b/inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodEngine.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..1f2f6b7236f999e01d38027835065cac1c19f31b --- /dev/null +++ b/inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodEngine.test.ets @@ -0,0 +1,1205 @@ +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import commoneventmanager from '@ohos.commonEventManager'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import subtype from '@ohos.InputMethodSubtype'; +import inputMethod from '@ohos.inputMethod'; +import display from '@ohos.display'; + + +export default function inputMethodEngineJSUnit() { + describe('inputMethodEngine', function () { + var inputSever = { + packageName: '', + methodId: '', + name: '', + id: '', + extra: {} + } + + /** + * beforeEach: Prerequisites at the test case level, which are executed before each test case is executed. + */ + beforeAll(async (done) => { + let inputM = inputMethod.getCurrentInputMethod(); + console.info("====>beforeAll: getCurrentInputMethod inputMethodEngineJSUnit to: " + JSON.stringify(inputM)); + inputSever.packageName = inputM.packageName; + inputSever.methodId = inputM.methodId; + inputSever.name = inputM.packageName; + inputSever.id = inputM.methodId; + + let inputDemoService: subtype = { + id: "com.acts.inputmethodengine.test", + label: "InputDemoService", + name: "", + mode: "lower", + locale: "", + language: "", + icon: "", + iconId: 0, + extra: {} + } + try { + await inputMethod.switchCurrentInputMethodSubtype(inputDemoService); + setTimeout(() => { + console.info("====>beforeAll: inputMethodEngineJSUnit switchCurrentInputMethodSubtype success"); + done(); + }, 2000) + } catch (err) { + console.info("====>beforeAll: inputMethodEngineJSUnit fail" + JSON.stringify(err)); + } + }) + + /** + * afterEach: Test case-level clearance conditions, which are executed after each test case is executed. + */ + afterAll(async (done) => { + try { + await inputMethod.switchInputMethod(inputSever); + setTimeout(() => { + console.info("====>afterAll: inputMethodEngineJSUnit switchInputMethod success"); + done(); + }, 2000) + } catch (err) { + console.info("====>afterAll: inputMethodEngineJSUnit fail" + JSON.stringify(err)); + } + }) + + let dis = display.getDefaultDisplaySync(); + let w = dis.width / 2; + let h = dis.height /2; + let getFocusCmd = `uinput -T -c ${w} ${h}`; + let abilityDelegator; + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + async function runCmd(cmd) { + console.info("====>runCmdInfo: " + cmd); + await abilityDelegator.executeShellCommand(cmd); + } + + it('inputMethodEngine_test_getInputMethodEngine_001', 0, async function (done) { + function unSubscriberCallback(err) { + console.info("====>inputMethodEngine_test_getInputMethodEngine_001 unSubscriberCallback start"); + if (err) { + console.error("====>inputMethodEngine_test_getInputMethodEngine_001 unSubscriberCallback failed: " + JSON.stringify(err)); + } else { + console.info("====>inputMethodEngine_test_getInputMethodEngine_001 unSubscriberCallback finsh"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_getInputMethodEngine_001 subscriberCallback data: " + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_getInputMethodEngine_001 end<===="); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_getInputMethodEngine_001 end<====" + JSON.stringify(err)); + clearTimeout(t) + done(); + } + }, 500) + } + + async function publishCallback(err) { + if (err) { + console.debug("====>inputMethodEngine_test_getInputMethodEngine_001 end<====" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_getInputMethodEngine_001"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then(function (data) { + subscriber = data; + console.debug("====>inputMethodEngine_test_getInputMethodEngine_001 subscribe data: " + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_getInputMethodEngine_001 subscribe finish===="); + }) + + var commonEventPublishData = { + code: 1 + } + commoneventmanager.publish("test1", commonEventPublishData, publishCallback); + + }); + + it('inputMethodEngine_test_getKeyboardDelegate_001', 0, async function (done) { + function unSubscriberCallback(err) { + console.info("====>inputMethodEngine_test_getKeyboardDelegate_001 unSubscriberCallback start"); + if (err) { + console.error("====>inputMethodEngine_test_getKeyboardDelegate_001 unSubscriberCallback failed: " + JSON.stringify(err)); + } else { + console.info("====>inputMethodEngine_test_getKeyboardDelegate_001 unSubscriberCallback finsh"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_getKeyboardDelegate_001 subscriberCallback data: " + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_getKeyboardDelegate_001 end<===="); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_getKeyboardDelegate_001 end<====" + JSON.stringify(err)); + clearTimeout(t) + done(); + } + }, 500) + } + + async function publishCallback(err) { + if (err) { + console.debug("====>inputMethodEngine_test_getKeyboardDelegate_001 end<====" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_getKeyboardDelegate_001"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then(function (data) { + subscriber = data; + console.debug("====>inputMethodEngine_test_getKeyboardDelegate_001 subscribe data: " + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_getKeyboardDelegate_001 subscribe finish===="); + }) + + var commonEventPublishData = { + code: 2 + } + commoneventmanager.publish("test1", commonEventPublishData, publishCallback); + + }); + + it('inputMethodEngine_test_028', 0, async function (done) { + + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_028 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_028 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_028 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_028 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_028 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_028 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_028 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_028 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_028"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_028 subscriber data:" + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_028 subscriber finish"); + }) + + var commonEventPublishData = { + code: 28 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_029', 0, async function (done) { + + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_029 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_029 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_029 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_029 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_029 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_029 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_029 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_029 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_029"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_029 subscriber data:" + JSON.stringify(data)) + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_029 subscriber finish"); + }) + + var commonEventPublishData = { + code: 29 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_030', 0, async function (done) { + + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_030 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_030 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_030 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_030 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_030 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_030 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_030 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_030 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_030"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_030 subscriber data:" + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_030 subscriber finish"); + }) + + var commonEventPublishData = { + code: 30 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_031', 0, async function (done) { + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_031 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_031 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_031 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_031 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_031 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_031 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 10000) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_031 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_031 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_031"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_031 subscriber data:" + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_031 subscriber finish"); + }) + + var commonEventPublishData = { + code: 31 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_032', 0, async function (done) { + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_032 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_032 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_032 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_032 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_032 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_032 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_032 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_032 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_032"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_032 subscriber data:" + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_032 subscriber finish"); + }) + + var commonEventPublishData = { + code: 32 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_033', 0, async function (done) { + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_033 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_033 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_033 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_033 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_033 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_033 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_033 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_033 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_033"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_033 subscriber data:" + JSON.stringify(data)) + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_033 subscriber finish") + }) + + var commonEventPublishData = { + code: 33 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback) + }); + + it('inputMethodEngine_test_034', 0, async function (done) { + + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_034 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_034 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_034 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_034 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_034 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_034 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_034 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_034 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_034"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_034 subscriber data:" + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_034 subscriber finish"); + }) + + var commonEventPublishData = { + code: 34 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_035', 0, async function (done) { + + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_035 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_035 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_035 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_035 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_035 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_035 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_035 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_035 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_035"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_035 subscriber data:" + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_035 subscriber finish"); + }) + + var commonEventPublishData = { + code: 35 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_036', 0, async function (done) { + + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_036 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_036 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_036 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_036 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_036 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_036 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_036 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_036 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_036"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_036 subscriber data:" + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_036 subscriber finish"); + }) + + var commonEventPublishData = { + code: 36 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_037', 0, async function (done) { + + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_037 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_037 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_037 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_037 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_037 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_037 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_037 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_037 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_037"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_037 subscriber data:" + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_037 subscriber finish"); + }) + + var commonEventPublishData = { + code: 37 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_038', 0, async function (done) { + + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_038 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_038 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_038 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_038 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_038 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_038 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_038 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_038 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_038"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_038 subscriber data:" + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_038 subscriber finish"); + }) + + var commonEventPublishData = { + code: 38 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_039', 0, async function (done) { + + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_039 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_039 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_039 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_039 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_039 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_039 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_039 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_039 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_039"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_039 subscriber data:" + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_039 subscriber finish"); + }) + + var commonEventPublishData = { + code: 39 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_040', 0, async function (done) { + + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_040 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_040 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_040 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_040 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_040 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_040 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_040 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_040 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_040"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_040 subscriber data:" + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_040 subscriber finish"); + }) + + var commonEventPublishData = { + code: 40 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_041', 0, async function (done) { + + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_041 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_041 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_041 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_041 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_041 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_041 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_041 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_041 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_041"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_041 subscriber data:" + JSON.stringify(data)) + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_041 subscriber finish"); + }) + + var commonEventPublishData = { + code: 41 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_042', 0, async function (done) { + + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_042 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_042 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_042 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_042 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_042 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_042 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_042 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_042 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_042"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_042 subscriber data:" + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_042 subscriber finish"); + }) + + var commonEventPublishData = { + code: 42 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_043', 0, async function (done) { + + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_043 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_043 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_043 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_043 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_043 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_043 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_043 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_043 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_043"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_043 subscriber data:" + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_043 subscriber finish"); + }) + + var commonEventPublishData = { + code: 43 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_049', 0, async function (done) { + + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_049 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_049 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_049 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_049 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_049 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_049 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_049 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_049 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_049"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_049 subscriber data:" + JSON.stringify(data)) + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_049 subscriber finish") + }) + + var commonEventPublishData = { + code: 49 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + it('inputMethodEngine_test_050', 0, async function (done) { + + function unSubscriberCallback(err) { + console.debug("====>inputMethodEngine_test_050 unSubscriberCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_050 unSubscriberCallback failed:" + + JSON.stringify(err)); + } else { + console.debug("====>inputMethodEngine_test_050 unSubscriberCallback finish"); + } + } + + function subscriberCallback(err, data) { + console.debug("====>inputMethodEngine_test_050 subscriberCallback data:" + + JSON.stringify(data)); + commoneventmanager.unsubscribe(subscriber, unSubscriberCallback); + let t = setTimeout(() => { + try { + expect(data.data).assertEqual("SUCCESS"); + console.debug("====>inputMethodEngine_test_050 end"); + clearTimeout(t); + done(); + } catch (err) { + console.debug("====>inputMethodEngine_test_050 err:" + JSON.stringify(err)); + clearTimeout(t); + done(); + } + }, 500) + } + + function publishCallback(err) { + console.debug("====>inputMethodEngine_test_050 publishCallback start"); + if (err) { + console.debug("====>inputMethodEngine_test_050 publishCallback failed:" + JSON.stringify(err)); + } else { + runCmd(getFocusCmd); + } + } + + var commonEventSubscribeInfo = { + events: ["inputMethodEngine_test_050"] + } + var subscriber; + commoneventmanager.createSubscriber(commonEventSubscribeInfo).then((data) => { + subscriber = data; + console.debug("====>inputMethodEngine_test_050 subscriber data:" + JSON.stringify(data)); + commoneventmanager.subscribe(subscriber, subscriberCallback); + console.debug("====>inputMethodEngine_test_050 subscriber finish"); + }) + + var commonEventPublishData = { + code: 50 + } + commoneventmanager.publish('test1', commonEventPublishData, publishCallback); + }); + + + }) +} \ No newline at end of file diff --git a/inputmethod/InputMethodEngine/entry/src/main/module.json b/inputmethod/InputMethodEngine/entry/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..a45b1e6b61b287731fbab74c6115c0daea3015fd --- /dev/null +++ b/inputmethod/InputMethodEngine/entry/src/main/module.json @@ -0,0 +1,73 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "tablet", + "default", + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "false" + } + ], + "abilities": [ + { + "name": "com.acts.inputmethodengine.test.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "launchType": "singleton", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities":[ + "entity.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "description": "输入法demoStage", + "icon": "$media:icon", + "name": "inputStageService", + "srcEntrance": "./ets/InputMethodAbility/InputStageService.ts", + "type": "inputMethod", + "visible":true + }, + { + "description": "输入法Demo", + "icon": "$media:icon", + "name": "InputDemoService", + "srcEntrance": "./ets/InputMethodEngine/InputDemoService.ts", + "type": "inputMethod", + "visible":true + } + ], + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CONNECT_IME_ABILITY" + } + ] + } +} diff --git a/inputmethod/InputMethodEngine/entry/src/main/resources/base/element/string.json b/inputmethod/InputMethodEngine/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..ea8ffb9ce5faaafb968771c65a5ac50db871e1ff --- /dev/null +++ b/inputmethod/InputMethodEngine/entry/src/main/resources/base/element/string.json @@ -0,0 +1,36 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsImeAbilityTest" + }, + { + "name": "ime_description", + "value": "input method extension ability." + }, + { + "name": "ime_label", + "value": "inputMethod extension ability services." + }, + { + "name": "ime_label_1", + "value": "inputMethod extension ability services_1." + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} diff --git a/inputmethod/InputMethodEngine/entry/src/main/resources/base/media/icon.png b/inputmethod/InputMethodEngine/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/inputmethod/InputMethodEngine/entry/src/main/resources/base/media/icon.png differ diff --git a/inputmethod/InputMethodEngine/entry/src/main/resources/base/profile/main_pages.json b/inputmethod/InputMethodEngine/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..6898b31d2085f478ee1ed9d933a5910cbf901d92 --- /dev/null +++ b/inputmethod/InputMethodEngine/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/inputmethod/InputMethodEngine/signature/ActsInputMethodEngineTest.p7b b/inputmethod/InputMethodEngine/signature/ActsInputMethodEngineTest.p7b new file mode 100644 index 0000000000000000000000000000000000000000..d382197f94ab570f2eb5d360c76995a394553b16 Binary files /dev/null and b/inputmethod/InputMethodEngine/signature/ActsInputMethodEngineTest.p7b differ diff --git a/multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js b/multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js index 65832cee7e766e524d0144079f8397855e3b131e..5909e5c217a56524f9efbcea7f91b3ff7221ac27 100644 --- a/multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js +++ b/multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js @@ -22,6 +22,7 @@ export default function ImageReceiver() { const CAPACITY = 8; const RGBA = 12; const Jpg_Stride = 1; + const DEVICE_CODE = 801; const { JPEG: FORMATJPEG } = image.ImageFormat; const { JPEG } = image.ComponentType; beforeAll(async function () { @@ -67,6 +68,11 @@ export default function ImageReceiver() { expect(false).assertTrue(); done(); } else { + var error = receiver.checkDeviceTest; + if (DEVICE_CODE == error) { + expect(error == DEVICE_CODE).assertTrue(); + done(); + } receiver.on("imageArrival", () => { if (once) { return; @@ -108,6 +114,11 @@ export default function ImageReceiver() { expect(false).assertTrue(); done(); } else { + var error = receiver.checkDeviceTest; + if (DEVICE_CODE == error) { + expect(error == DEVICE_CODE).assertTrue(); + done(); + } receiver.on("imageArrival", () => { if (once) { return; @@ -150,6 +161,11 @@ export default function ImageReceiver() { expect(false).assertTrue(); return; } + var error = receiver.checkDeviceTest; + if (DEVICE_CODE == error) { + expect(error == DEVICE_CODE).assertTrue(); + done(); + } receiver.on("imageArrival", () => { if (once) { return; @@ -199,6 +215,11 @@ export default function ImageReceiver() { done(); return; } + var error = receiver.checkDeviceTest; + if (DEVICE_CODE == error) { + expect(error == DEVICE_CODE).assertTrue(); + done(); + } receiver.on("imageArrival", () => { if (once) { return; @@ -244,6 +265,11 @@ export default function ImageReceiver() { done(); } else { try { + var error = receiver.checkDeviceTest; + if (DEVICE_CODE == error) { + expect(error == DEVICE_CODE).assertTrue(); + done(); + } receiver.on(param, () => { expect(false).assertTrue(); }); @@ -635,6 +661,11 @@ export default function ImageReceiver() { */ it("SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100", 0, async function (done) { var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY); + var error = receiver.checkDeviceTest; + if (DEVICE_CODE == error) { + expect(error == DEVICE_CODE).assertTrue(); + done(); + } var dummy = receiver.test; if (receiver != undefined) { receiver @@ -668,6 +699,11 @@ export default function ImageReceiver() { */ it("SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100", 0, async function (done) { var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY); + var error = receiver.checkDeviceTest; + if (DEVICE_CODE == error) { + expect(error == DEVICE_CODE).assertTrue(); + done(); + } var dummy = receiver.test; if (receiver != undefined) { receiver.readLatestImage((err, img) => { @@ -696,6 +732,11 @@ export default function ImageReceiver() { */ it("SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100", 0, async function (done) { var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY); + var error = receiver.checkDeviceTest; + if (DEVICE_CODE == error) { + expect(error == DEVICE_CODE).assertTrue(); + done(); + } var dummy = receiver.test; expect(receiver != undefined).assertTrue(); if (receiver != undefined) { @@ -730,6 +771,11 @@ export default function ImageReceiver() { */ it("SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100", 0, async function (done) { var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY); + var error = receiver.checkDeviceTest; + if (DEVICE_CODE == error) { + expect(error == DEVICE_CODE).assertTrue(); + done(); + } var dummy = receiver.test; if (receiver != undefined) { receiver.readNextImage((err, img) => { @@ -824,6 +870,11 @@ export default function ImageReceiver() { expect(false).assertTrue(); done(); } else { + var error = receiver.checkDeviceTest; + if (DEVICE_CODE == error) { + expect(error == DEVICE_CODE).assertTrue(); + done(); + } let pass = false; receiver.on("imageArrival", (err) => { if (err) { @@ -862,7 +913,11 @@ export default function ImageReceiver() { done(); return; } - + var error = receiver.checkDeviceTest; + if (DEVICE_CODE == error) { + expect(error == DEVICE_CODE).assertTrue(); + done(); + } receiver.on("imageArrival", () => { expect(true).assertTrue(); }); @@ -922,13 +977,15 @@ export default function ImageReceiver() { done(); return; } - + var error = receiver.checkDeviceTest; + if (DEVICE_CODE == error) { + expect(error == DEVICE_CODE).assertTrue(); + done(); + } receiver.on("imageArrival", () => { expect(true).assertTrue(); }); - var dummy = receiver.test; - receiver.readLatestImage((err, img) => { if (img == undefined) { expect(false).assertTrue(); diff --git a/multimedia/medialibrary/mediaLibrary_album/BUILD.gn b/multimedia/medialibrary/mediaLibrary_album/BUILD.gn index 463f4cfe7c4aee4fba4ba5ed3282ab049ef2f5b2..07098041be96cb734d3113b95ec9f86f735943ef 100644 --- a/multimedia/medialibrary/mediaLibrary_album/BUILD.gn +++ b/multimedia/medialibrary/mediaLibrary_album/BUILD.gn @@ -23,6 +23,8 @@ ohos_js_hap_suite("mediaLibrary_album_hap") { ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsMediaLibraryAlbumTest" + part_name = "media_library" + subsystem_name = "multimedia" } ohos_app_scope("medialibrary_app_profile") { diff --git a/multimedia/medialibrary/mediaLibrary_base/BUILD.gn b/multimedia/medialibrary/mediaLibrary_base/BUILD.gn index 6c245406c437668310a796dbb3ac0f4a847d0a43..9da72da3ec0ef66f61d2f32c5d993f155fafc3ee 100644 --- a/multimedia/medialibrary/mediaLibrary_base/BUILD.gn +++ b/multimedia/medialibrary/mediaLibrary_base/BUILD.gn @@ -23,6 +23,8 @@ ohos_js_hap_suite("mediaLibrary_base_hap") { ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsMediaLibraryBaseTest" + part_name = "media_library" + subsystem_name = "multimedia" } ohos_app_scope("medialibrary_app_profile") { diff --git a/multimedia/medialibrary/mediaLibrary_favorite/BUILD.gn b/multimedia/medialibrary/mediaLibrary_favorite/BUILD.gn index a6163ed650ff2e9229469fd278bdae48543b782e..e67b7f19ab7535dfd8d0b159cf0793a7b53f0c46 100644 --- a/multimedia/medialibrary/mediaLibrary_favorite/BUILD.gn +++ b/multimedia/medialibrary/mediaLibrary_favorite/BUILD.gn @@ -23,6 +23,8 @@ ohos_js_hap_suite("mediaLibrary_favorite_hap") { ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsMediaLibraryFavoriteTest" + part_name = "media_library" + subsystem_name = "multimedia" } ohos_app_scope("medialibrary_app_profile") { diff --git a/multimedia/medialibrary/mediaLibrary_file/BUILD.gn b/multimedia/medialibrary/mediaLibrary_file/BUILD.gn index b03276f2f841ca29a805191a67e72a5764d3cb35..e6221688ca125cb64a302f53a339670f629bcaa2 100644 --- a/multimedia/medialibrary/mediaLibrary_file/BUILD.gn +++ b/multimedia/medialibrary/mediaLibrary_file/BUILD.gn @@ -23,6 +23,8 @@ ohos_js_hap_suite("mediaLibrary_file_hap") { ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsMediaLibraryFileTest" + part_name = "media_library" + subsystem_name = "multimedia" } ohos_app_scope("medialibrary_app_profile") { diff --git a/multimedia/medialibrary/mediaLibrary_fileAsset/BUILD.gn b/multimedia/medialibrary/mediaLibrary_fileAsset/BUILD.gn index e893f7ed60f7fbd7cc22eeec196418a047b2b0ea..f8f6012f7afbd02c633874697135407258c021bf 100644 --- a/multimedia/medialibrary/mediaLibrary_fileAsset/BUILD.gn +++ b/multimedia/medialibrary/mediaLibrary_fileAsset/BUILD.gn @@ -23,6 +23,8 @@ ohos_js_hap_suite("mediaLibrary_fileAsset_hap") { ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsMediaLibraryFileAssetTest" + part_name = "media_library" + subsystem_name = "multimedia" } ohos_app_scope("medialibrary_app_profile") { diff --git a/multimedia/medialibrary/mediaLibrary_fileKey/BUILD.gn b/multimedia/medialibrary/mediaLibrary_fileKey/BUILD.gn index 4a22b8009934215a083b565b6217dfbb32db2b7f..74656b4dd2f1d8019094988d249e3e7812c58f34 100644 --- a/multimedia/medialibrary/mediaLibrary_fileKey/BUILD.gn +++ b/multimedia/medialibrary/mediaLibrary_fileKey/BUILD.gn @@ -23,6 +23,8 @@ ohos_js_hap_suite("mediaLibrary_fileKey_hap") { ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsMediaLibraryFileKeyTest" + part_name = "media_library" + subsystem_name = "multimedia" } ohos_app_scope("medialibrary_app_profile") { diff --git a/multimedia/medialibrary/mediaLibrary_fileResult/BUILD.gn b/multimedia/medialibrary/mediaLibrary_fileResult/BUILD.gn index 81a86a6ca73f117da3176d1f1542cd43baa1c2b8..5eb900935d86473263a54697fcb2c6c02c15461a 100644 --- a/multimedia/medialibrary/mediaLibrary_fileResult/BUILD.gn +++ b/multimedia/medialibrary/mediaLibrary_fileResult/BUILD.gn @@ -23,6 +23,8 @@ ohos_js_hap_suite("mediaLibrary_fileResult_hap") { ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsMediaLibraryFileResultTest" + part_name = "media_library" + subsystem_name = "multimedia" } ohos_app_scope("medialibrary_app_profile") { diff --git a/multimedia/medialibrary/mediaLibrary_getThumbnail/BUILD.gn b/multimedia/medialibrary/mediaLibrary_getThumbnail/BUILD.gn index 028e642905182961f2aece3e09ac5d2be873796b..b10ed9bd40d5aa02317f65c196b2fc641d60dc36 100644 --- a/multimedia/medialibrary/mediaLibrary_getThumbnail/BUILD.gn +++ b/multimedia/medialibrary/mediaLibrary_getThumbnail/BUILD.gn @@ -23,6 +23,8 @@ ohos_js_hap_suite("mediaLibrary_getThumbnail_hap") { ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsMediaLibraryGetThumbnailTest" + part_name = "media_library" + subsystem_name = "multimedia" } ohos_app_scope("medialibrary_app_profile") { diff --git a/multimedia/medialibrary/mediaLibrary_mediafetchoptions/BUILD.gn b/multimedia/medialibrary/mediaLibrary_mediafetchoptions/BUILD.gn index 7b5f777c28b313b36e86e12e7989e5747a0cc29a..7191c6391fd374507400fda72d53d69ce7851421 100644 --- a/multimedia/medialibrary/mediaLibrary_mediafetchoptions/BUILD.gn +++ b/multimedia/medialibrary/mediaLibrary_mediafetchoptions/BUILD.gn @@ -23,6 +23,8 @@ ohos_js_hap_suite("mediaLibrary_mediafetchoptions_hap") { ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsMediaLibraryMediafetchoptionsTest" + part_name = "media_library" + subsystem_name = "multimedia" } ohos_app_scope("medialibrary_app_profile") { diff --git a/multimedia/medialibrary/mediaLibrary_trash/BUILD.gn b/multimedia/medialibrary/mediaLibrary_trash/BUILD.gn index f328ea2a9ec87ea66c4d3e43c49a8a08a77d4ee1..8e47094581e294a90104f586540b57b173d2673b 100644 --- a/multimedia/medialibrary/mediaLibrary_trash/BUILD.gn +++ b/multimedia/medialibrary/mediaLibrary_trash/BUILD.gn @@ -23,6 +23,8 @@ ohos_js_hap_suite("mediaLibrary_trash_js_hap") { ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsMediaLibraryTrashJsTest" + part_name = "media_library" + subsystem_name = "multimedia" } ohos_app_scope("medialibrary_app_profile") { diff --git a/notification/ces_standard/actsCommonEventManagerSupportTest/src/main/js/test/ActsCommonEventManagerSupportTest.js b/notification/ces_standard/actsCommonEventManagerSupportTest/src/main/js/test/ActsCommonEventManagerSupportTest.js index 58f137984ae7bfca7b1912050718a630bf6ce0dd..f664e12863fdd650ed2d6582e95b8adb28fc691b 100644 --- a/notification/ces_standard/actsCommonEventManagerSupportTest/src/main/js/test/ActsCommonEventManagerSupportTest.js +++ b/notification/ces_standard/actsCommonEventManagerSupportTest/src/main/js/test/ActsCommonEventManagerSupportTest.js @@ -186,7 +186,7 @@ export default function ActsCommonEventManagerSupportTest() { */ it('SUB_NOTIFICATION_CES_MANAGER_SUPPORT_ENUM_TEST_1100', 0, async function () { console.info(`${TAG} SUB_NOTIFICATION_CES_MANAGER_SUPPORT_ENUM_TEST_1100 START`) - expect(commonEventManager.Support.COMMON_EVENT_WIFI_POWER_STATE).assertEqual('usual.event.wifi.POWER_STATE') + expect(commonEventManager.Support.COMMON_EVENT_WIFI_POWER_STATE).assertEqual('usual.event.wifi.POWER_STATE') expect(commonEventManager.Support.COMMON_EVENT_WIFI_SCAN_FINISHED).assertEqual('usual.event.wifi.SCAN_FINISHED') expect(commonEventManager.Support.COMMON_EVENT_WIFI_RSSI_VALUE).assertEqual('usual.event.wifi.RSSI_VALUE') expect(commonEventManager.Support.COMMON_EVENT_WIFI_CONN_STATE).assertEqual('usual.event.wifi.CONN_STATE') @@ -204,7 +204,7 @@ export default function ActsCommonEventManagerSupportTest() { }) /* - * @tc.number : SUB_NOTIFICATION_CES_MANAGER_SUPPORT_ENUM_TEST_1300 + * @tc.number : SUB_NOTIFICATION_CES_MANAGER_SUPPORT_ENUM_TEST_1200 * @tc.name : commonEventManager.Support * @tc.desc : Bluetooth */ @@ -377,11 +377,51 @@ export default function ActsCommonEventManagerSupportTest() { expect(commonEventManager.Support.COMMON_EVENT_SLOT_CHANGE).assertEqual('usual.event.SLOT_CHANGE') expect(commonEventManager.Support.COMMON_EVENT_SPN_INFO_CHANGED).assertEqual('usual.event.SPN_INFO_CHANGED') expect(commonEventManager.Support.COMMON_EVENT_QUICK_FIX_APPLY_RESULT).assertEqual('usual.event.QUICK_FIX_APPLY_RESULT') - expect(commonEventManager.Support.COMMON_EVENT_USER_INFO_UPDATED ).assertEqual('usual.event.USER_INFO_UPDATED') - expect(commonEventManager.Support.COMMON_EVENT_HTTP_PROXY_CHANGE ).assertEqual('usual.event.HTTP_PROXY_CHANGE') + expect(commonEventManager.Support.COMMON_EVENT_USER_INFO_UPDATED).assertEqual('usual.event.USER_INFO_UPDATED') + expect(commonEventManager.Support.COMMON_EVENT_HTTP_PROXY_CHANGE).assertEqual('usual.event.HTTP_PROXY_CHANGE') console.info(`${TAG} SUB_NOTIFICATION_CES_MANAGER_SUPPORT_ENUM_TEST_2000 END`) }) + /* + * @tc.number : SUB_NOTIFICATION_CES_MANAGER_SUPPORT_ENUM_TEST_2100 + * @tc.name : commonEventManager.Support + * @tc.desc : SIM common event + */ + it('SUB_NOTIFICATION_CES_MANAGER_SUPPORT_ENUM_TEST_2100', 0, async function () { + console.info(`${TAG} SUB_NOTIFICATION_CES_MANAGER_SUPPORT_ENUM_TEST_2100 START`) + expect(commonEventManager.Support.COMMON_EVENT_SIM_STATE_CHANGED).assertEqual('usual.event.SIM_STATE_CHANGED') + expect(commonEventManager.Support.COMMON_EVENT_SIM_CARD_DEFAULT_SMS_SUBSCRIPTION_CHANGED).assertEqual('usual.event.SIM.DEFAULT_SMS_SUBSCRIPTION_CHANGED') + expect(commonEventManager.Support.COMMON_EVENT_SIM_CARD_DEFAULT_DATA_SUBSCRIPTION_CHANGED).assertEqual('usual.event.SIM.DEFAULT_DATA_SUBSCRIPTION_CHANGED') + expect(commonEventManager.Support.COMMON_EVENT_SIM_CARD_DEFAULT_MAIN_SUBSCRIPTION_CHANGED).assertEqual('usual.event.SIM.DEFAULT_MAIN_SUBSCRIPTION_CHANGED') + expect(commonEventManager.Support.COMMON_EVENT_SIM_CARD_DEFAULT_VOICE_SUBSCRIPTION_CHANGED).assertEqual('usual.event.SIM.DEFAULT_VOICE_SUBSCRIPTION_CHANGED') + expect(commonEventManager.Support.COMMON_EVENT_SMS_RECEIVED_COMPLETED).assertEqual('usual.event.SMS_RECEIVED_COMPLETED') + expect(commonEventManager.Support.COMMON_EVENT_SMS_EMERGENCY_CB_RECEIVE_COMPLETED).assertEqual('usual.event.SMS_EMERGENCY_CB_RECEIVE_COMPLETED') + expect(commonEventManager.Support.COMMON_EVENT_SMS_CB_RECEIVE_COMPLETED).assertEqual('usual.event.SMS_CB_RECEIVE_COMPLETED') + expect(commonEventManager.Support.COMMON_EVENT_SMS_WAPPUSH_RECEIVE_COMPLETED).assertEqual('usual.event.SMS_WAPPUSH_RECEIVE_COMPLETED') + expect(commonEventManager.Support.COMMON_EVENT_OPERATOR_CONFIG_CHANGED).assertEqual('usual.event.OPERATOR_CONFIG_CHANGED') + expect(commonEventManager.Support.COMMON_EVENT_CALL_STATE_CHANGED).assertEqual('usual.event.CALL_STATE_CHANGED') + expect(commonEventManager.Support.COMMON_EVENT_INCOMING_CALL_MISSED).assertEqual('usual.event.INCOMING_CALL_MISSED') + expect(commonEventManager.Support.COMMON_EVENT_CELLULAR_DATA_STATE_CHANGED).assertEqual('usual.event.CELLULAR_DATA_STATE_CHANGED') + expect(commonEventManager.Support.COMMON_EVENT_NETWORK_STATE_CHANGED).assertEqual('usual.event.NETWORK_STATE_CHANGED') + expect(commonEventManager.Support.COMMON_EVENT_SIGNAL_INFO_CHANGED).assertEqual('usual.event.SIGNAL_INFO_CHANGED') + console.info(`${TAG} SUB_NOTIFICATION_CES_MANAGER_SUPPORT_ENUM_TEST_2100 END`) + }) + + /* + * @tc.number : SUB_NOTIFICATION_CES_MANAGER_SUPPORT_ENUM_TEST_2200 + * @tc.name : commonEventManager.Support + * @tc.desc : STK common event + */ + it('SUB_NOTIFICATION_CES_MANAGER_SUPPORT_ENUM_TEST_2200', 0, async function () { + console.info(`${TAG} SUB_NOTIFICATION_CES_MANAGER_SUPPORT_ENUM_TEST_2200 START`) + expect(commonEventManager.Support.COMMON_EVENT_STK_COMMAND).assertEqual('usual.event.STK_COMMAND') + expect(commonEventManager.Support.COMMON_EVENT_STK_SESSION_END).assertEqual('usual.event.STK_SESSION_END') + expect(commonEventManager.Support.COMMON_EVENT_STK_CARD_STATE_CHANGED).assertEqual('usual.event.STK_CARD_STATE_CHANGED') + expect(commonEventManager.Support.COMMON_EVENT_STK_ALPHA_IDENTIFIER).assertEqual('usual.event.STK_ALPHA_IDENTIFIER') + expect(commonEventManager.Support.COMMON_EVENT_RADIO_STATE_CHANGE).assertEqual('usual.event.RADIO_STATE_CHANGE') + console.info(`${TAG} SUB_NOTIFICATION_CES_MANAGER_SUPPORT_ENUM_TEST_2200 END`) + }) + console.info(`${TAG} SUB_NOTIFICATION_CES_SUPPORT_ENUM_TEST END`) }) diff --git a/startup/startup_standard/deviceinfo/src/main/js/test/DeviceInfoJsUnit.test.js b/startup/startup_standard/deviceinfo/src/main/js/test/DeviceInfoJsUnit.test.js index 30887896602fa104abf7d1bf8d1a91e8d3b933ee..a3b2f35fec6e0f2c5f97b154be8d223f446fa075 100644 --- a/startup/startup_standard/deviceinfo/src/main/js/test/DeviceInfoJsUnit.test.js +++ b/startup/startup_standard/deviceinfo/src/main/js/test/DeviceInfoJsUnit.test.js @@ -385,7 +385,7 @@ export default function DeviceInfoTest() { expect(securityPatchTagInfo).assertInstanceOf('String'); if (securityPatchTagInfo != "" && securityPatchTagInfo != null && securityPatchTagInfo != undefined) { - let str = /[\w-\.\(\)]/g; + let str = /[\w\/\.\(\)]/g; let arr = securityPatchTagInfo.match(str); let bufferstr = arr.join(''); console.info('the value of the bufferstr is :' + bufferstr); @@ -1571,7 +1571,7 @@ export default function DeviceInfoTest() { let securityPatchTagInfo = deviceinfo.securityPatchTag; console.info('the value of the deviceinfo securityPatchTag is :' + securityPatchTagInfo); - let reFormat = /^(\d{4})-(\d{2})-(\d{2})$/; + let reFormat = /^(\d{4})\/(\d{2})\/(\d{2})$/; let re = securityPatchTagInfo.match(reFormat); if (re != null) { diff --git a/startup_lite/syspara_hal/src/deviceinfo_func_test.c b/startup_lite/syspara_hal/src/deviceinfo_func_test.c index aa1004b7c8e6f667eee2bcf7345df14f10a6c678..8f89b6d3be9a398a9eac7e134d559b7439a834e0 100644 --- a/startup_lite/syspara_hal/src/deviceinfo_func_test.c +++ b/startup_lite/syspara_hal/src/deviceinfo_func_test.c @@ -465,12 +465,12 @@ LITE_TEST_CASE(DeviceInfoFuncTestSuite, int year, month, day; const int RET_SUCCESS = 0; - int ret = sscanf_s(value, "%04d-%02d-%02d", &year, &month, &day); + int ret = sscanf_s(value, "%04d\/%02d\/%02d", &year, &month, &day); if (ret < RET_SUCCESS) { TEST_ASSERT_TRUE(ret >= 0); } - printf("%04d-%02d-%02d\n", year, month, day); + printf("%04d\/%02d\/%02d\n", year, month, day); TEST_ASSERT_TRUE(year > 1900 && year < 2056); TEST_ASSERT_TRUE(month <= 12 && month > 0); diff --git a/storage/storagepickerjstest/BUILD.gn b/storage/storagepickerjstest/BUILD.gn index 8ba0e4ba0ab7664c17f322e97d193857aa9e5a65..4662cbdb9d9393ed5816c0639cf5ab62efede3b4 100644 --- a/storage/storagepickerjstest/BUILD.gn +++ b/storage/storagepickerjstest/BUILD.gn @@ -23,6 +23,8 @@ ohos_js_hap_suite("storagepicker_js_test") { ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsStoragePickerJSTest" + part_name = "user_file_service" + subsystem_name = "filemanagement" } ohos_app_scope("storagepicker_app_profile") { diff --git a/theme/wallpaper_ets/entry/src/main/ets/test/wallpaperTest.ets b/theme/wallpaper_ets/entry/src/main/ets/test/wallpaperTest.ets index 17f67ddb6e24c9ff52cb8ac17cb98c4b92cf3e55..c291746e1aa334d4822b0c9fccec3b93733ef102 100644 --- a/theme/wallpaper_ets/entry/src/main/ets/test/wallpaperTest.ets +++ b/theme/wallpaper_ets/entry/src/main/ets/test/wallpaperTest.ets @@ -62,6 +62,7 @@ export default function wallpaperJSUnit() { */ it('testGetColorsCallbackSystem101', 0, async function (done) { console.info('--------------testGetColorsCallbackSystem101 start-----------------'); + await wallpaper.setWallpaper(imageSourceLockscreen, wallpaper.WallpaperType.WALLPAPER_SYSTEM); wallpaper.getColors(WALLPAPER_SYSTEM, (err, RgbaColors) => { try { if (err) { @@ -91,6 +92,7 @@ export default function wallpaperJSUnit() { */ it('testGetColorsPromiseSystem101', 0, async function (done) { console.info('--------------testGetColorsPromiseSystem101 start-----------------'); + await wallpaper.setWallpaper(imageSourceLockscreen, wallpaper.WallpaperType.WALLPAPER_SYSTEM); await wallpaper.getColors(WALLPAPER_SYSTEM).then((RgbaColors) => { console.info('====>testGetColorsPromiseSystem101 succesful RgbaColors: ' + JSON.stringify(RgbaColors)); expect(Number.isInteger(RgbaColors[0].red)).assertTrue(); @@ -114,6 +116,7 @@ export default function wallpaperJSUnit() { */ it('testGetColorsCallbackLock102', 0, async function (done) { console.info('--------------testGetColorsCallbackLock102 start-----------------'); + await wallpaper.setWallpaper(imageSourceLockscreen, wallpaper.WallpaperType.WALLPAPER_LOCKSCREEN); wallpaper.getColors(WALLPAPER_LOCKSCREEN, (err, RgbaColors) => { try { if (err) { @@ -143,6 +146,7 @@ export default function wallpaperJSUnit() { */ it('testGetColorsPromiseLock102', 0, async function (done) { console.info('--------------testGetColorsPromiseLock102 start-----------------'); + await wallpaper.setWallpaper(imageSourceLockscreen, wallpaper.WallpaperType.WALLPAPER_LOCKSCREEN); await wallpaper.getColors(WALLPAPER_LOCKSCREEN).then((RgbaColors) => { console.info('====>testGetColorsPromiseLock102 succesful RgbaColors: ' + JSON.stringify(RgbaColors)); expect(Number.isInteger(RgbaColors[0].red)).assertTrue(); @@ -682,8 +686,8 @@ export default function wallpaperJSUnit() { console.info('====>testOffCallback101 on callbackTime: ' + callbackTimes); expect(callbackTimes == 1).assertTrue(); wallpaper.off('colorChange'); - await wallpaper.reset(wallpaper.WallpaperType.WALLPAPER_SYSTEM) - await wallpaper.setWallpaper(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM) + await wallpaper.reset(wallpaper.WallpaperType.WALLPAPER_LOCKSCREEN) + await wallpaper.setWallpaper(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_LOCKSCREEN) console.info('====>testOffCallback101 setWallpaper successful'); console.info('--------------testOffCallback101 end-----------------'); done(); @@ -733,6 +737,7 @@ export default function wallpaperJSUnit() { */ it('testGetFilePromise101', 0, async function (done) { console.info('--------------testGetFilePromise101 start-----------------'); + await wallpaper.setWallpaper(imageSourceLockscreen, wallpaper.WallpaperType.WALLPAPER_LOCKSCREEN); await wallpaper.getFile(WALLPAPER_LOCKSCREEN).then((data) => { console.info('====>testGetFilePromise101 successful data : ' + JSON.stringify(data)); expect(Number.isInteger(data)).assertTrue();