From f33ca16039de2ba012183e99cec2c22705d0c48d Mon Sep 17 00:00:00 2001 From: chengxingzhen Date: Fri, 2 Sep 2022 11:21:11 +0800 Subject: [PATCH] =?UTF-8?q?XTSaacomand=E6=B5=8B=E8=AF=95=E5=A5=97=E9=80=82?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chengxingzhen --- .../src/main/ets/MainAbility/MainAbility.ts | 61 ++- .../entry/src/main/ets/pages/index.ets | 74 --- .../src/main/ets/MainAbility/MainAbility.ts | 460 ++++++++++++++++- .../entry/src/main/ets/pages/index.ets | 484 ------------------ 4 files changed, 519 insertions(+), 560 deletions(-) diff --git a/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts index 10cd64e80..629341379 100644 --- a/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -14,11 +14,70 @@ */ import Ability from '@ohos.application.Ability' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' +import testsuite from '../test/List.test' export default class MainAbility extends Ability { - onCreate(want, launchParam) { + async onCreate(want, launchParam) { globalThis.abilityContext = this.context; console.log('MainAbility onCreate') + let cmd: any + let abilityDelegatorArguments: any + let abilityDelegator: any + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + + cmd = 'aa test -b com.example.aacommandprintsync -m entry_test -s class ' + + 'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0100 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_printSync_01_0100 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_printSync_01_0100 stdResult = ' + data.stdResult) + globalThis.stdResult1 = data.stdResult; + console.log('ACTS_AACommand_printSync_01_0100 - executeShellCommand: end ') + }) + + await sleep(3000) + + cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' + + 'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0200 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_printSync_01_0200 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_printSync_01_0200 stdResult = ' + data.stdResult) + globalThis.stdResult2 = data.stdResult; + console.log('ACTS_AACommand_printSync_01_0200 - executeShellCommand: end ') + }) + + await sleep(3000) + + cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' + + 'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0300 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_printSync_01_0300 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_printSync_01_0300 stdResult = ' + data.stdResult) + globalThis.stdResult3 = data.stdResult; + console.log('ACTS_AACommand_printSync_01_0300 - executeShellCommand: end ') + }) + + await sleep(3000) + + cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' + + 'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0400 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_printSync_01_0400 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_printSync_01_0400 stdResult = ' + data.stdResult) + globalThis.stdResult4 = data.stdResult; + console.log('ACTS_AACommand_printSync_01_0400 - executeShellCommand: end ') + }) + + setTimeout(() => { + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + + }, 5000) } onDestroy() { diff --git a/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/pages/index.ets index e49699bde..be49947b3 100644 --- a/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/pages/index.ets +++ b/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/pages/index.ets @@ -13,83 +13,9 @@ * 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 { - aboutToAppear() { - console.info('MainAbility index aboutToAppear') - console.info('start run testcase!!!') - let cmd: any - let abilityDelegatorArguments: any - let abilityDelegator: any - - function sleep(delay) { - let start = (new Date()).getTime(); - while ((new Date()).getTime() - start < delay) { - continue; - } - } - function test(time) { - sleep(time); - } - - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - - cmd = 'aa test -b com.example.aacommandprintsync -m entry_test -s class ' + - 'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0100 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_printSync_01_0100 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_printSync_01_0100 stdResult = ' + data.stdResult) - globalThis.stdResult1 = data.stdResult; - console.log('ACTS_AACommand_printSync_01_0100 - executeShellCommand: end ') - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' + - 'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0200 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_printSync_01_0200 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_printSync_01_0200 stdResult = ' + data.stdResult) - globalThis.stdResult2 = data.stdResult; - console.log('ACTS_AACommand_printSync_01_0200 - executeShellCommand: end ') - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' + - 'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0300 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_printSync_01_0300 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_printSync_01_0300 stdResult = ' + data.stdResult) - globalThis.stdResult3 = data.stdResult; - console.log('ACTS_AACommand_printSync_01_0300 - executeShellCommand: end ') - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' + - 'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0400 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_printSync_01_0400 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_printSync_01_0400 stdResult = ' + data.stdResult) - globalThis.stdResult4 = data.stdResult; - console.log('ACTS_AACommand_printSync_01_0400 - executeShellCommand: end ') - }) - - test(3000) - - setTimeout(() => { - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - - }, 15000) - - } @State message: string = 'Hello World' build() { Row() { diff --git a/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/MainAbility.ts index 1e26ef72e..71eb66e8d 100644 --- a/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -14,10 +14,468 @@ */ import Ability from '@ohos.application.Ability' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' +import testsuite from '../test/List.test' export default class MainAbility extends Ability { - onCreate(want, launchParam) { + async onCreate(want, launchParam) { console.log('MainAbility onCreate') + let cmd: any + let abilityDelegatorArguments: any + let abilityDelegator: any + + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + + await sleep(500) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + + 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0700 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_0700 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_0700 stdResult = ' + data.stdResult) + globalThis.stdResult1 = data.stdResult; + console.log('ACTS_AACommand_finish_01_0700 - executeShellCommand: end ') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_0700 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_0700 : data : ' + JSON.stringify(data)); + globalThis.stdResult2 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_0700 end'); + }) + + await sleep(2000) + + cmd = 'aa test -b com.example.aacommandrelyhap -m entry_test -s class ACTS_AACommand_01_3#ACTS_AACo' + + 'mmand_print_01_0100 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_print_01_0100 - executeShellCommand: start ') + console.log('ACTS_AACommand_print_01_0100 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_print_01_0100 stdResult = ' + data.stdResult) + globalThis.stdResult3 = data.stdResult; + console.log('ACTS_AACommand_print_01_0100 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComm' + + 'and_print_01_0200 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_print_01_0200 - executeShellCommand: start ') + console.log('ACTS_AACommand_print_01_0200 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_print_01_0200 stdResult = ' + data.stdResult) + globalThis.stdResult4 = data.stdResult; + console.log('ACTS_AACommand_print_01_0200 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_' + + 'AACommand_print_01_0300 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_print_01_0300 - executeShellCommand: start ') + console.log('ACTS_AACommand_print_01_0300 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_print_01_0300 stdResult = ' + data.stdResult) + globalThis.stdResult5 = data.stdResult; + console.log('ACTS_AACommand_print_01_0300 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComma' + + 'nd_print_01_0400 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_print_01_0400 - executeShellCommand: start ') + console.log('ACTS_AACommand_print_01_0400 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_print_01_0400 stdResult = ' + data.stdResult) + globalThis.stdResult6 = data.stdResult; + console.log('ACTS_AACommand_print_01_0400 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComm' + + 'and_print_01_0500 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_print_01_0500 - executeShellCommand: start ') + console.log('ACTS_AACommand_print_01_0500 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_print_01_0500 stdResult = ' + data.stdResult) + globalThis.stdResult7 = data.stdResult; + console.log('ACTS_AACommand_print_01_0500 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AA' + + 'Command_print_01_0600 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_print_01_0600 - executeShellCommand: start ') + console.log('ACTS_AACommand_print_01_0600 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_print_01_0600 stdResult = ' + data.stdResult) + globalThis.stdResult8 = data.stdResult; + console.log('ACTS_AACommand_print_01_0600 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' + + 'ACTS_AACommand_01_3#ACTS_AACommand_print_01_0700 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_print_01_0700 - executeShellCommand: start ') + console.log('ACTS_AACommand_print_01_0700 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_print_01_0700 stdResult = ' + data.stdResult) + globalThis.stdResult9 = data.stdResult; + console.log('ACTS_AACommand_print_01_0700 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + + 'class ACTS_AACommand_01_3#ACTS_AACommand_print_01_0800 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_print_01_0800 - executeShellCommand: start ') + console.log('ACTS_AACommand_print_01_0800 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_print_01_0800 stdResult = ' + data.stdResult) + globalThis.stdResult10 = data.stdResult; + console.log('ACTS_AACommand_print_01_0800 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' + + 'ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0400 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_0400 - executeShellCommand: start ') + console.log('ACTS_AACommand_finish_01_0400 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_0400 stdResult = ' + data.stdResult) + globalThis.stdResult11 = data.stdResult; + console.log('ACTS_AACommand_finish_01_0400 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_0700 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_0700 : data : ' + JSON.stringify(data)); + globalThis.stdResult12 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_0700 end'); + }) + + await sleep(2000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + + 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0100 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_0100 - executeShellCommand: start ') + console.log('ACTS_AACommand_finish_01_0100 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_0100 stdResult = ' + data.stdResult) + globalThis.stdResult13 = data.stdResult; + console.log('ACTS_AACommand_finish_01_0100 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_0700 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_0700 : data : ' + JSON.stringify(data)); + globalThis.stdResult14 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_0700 end'); + }) + + await sleep(2000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' + + 'ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0500 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_0500 - executeShellCommand: start ') + console.log('ACTS_AACommand_finish_01_0500 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_0500 stdResult = ' + data.stdResult) + globalThis.stdResult15 = data.stdResult; + console.log('ACTS_AACommand_finish_01_0500 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_0500 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_0500 : data : ' + JSON.stringify(data)); + globalThis.stdResult16 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_0500 end'); + }) + + await sleep(2000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + + 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0600 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_0600 - executeShellCommand: start ') + console.log('ACTS_AACommand_finish_01_0600 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_0600 stdResult = ' + data.stdResult) + globalThis.stdResult17 = data.stdResult; + console.log('ACTS_AACommand_finish_01_0600 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_0600 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_0600 : data : ' + JSON.stringify(data)); + globalThis.stdResult18 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_0600 end'); + }) + + await sleep(2000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + + 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0900 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_0900 - executeShellCommand: start ') + console.log('ACTS_AACommand_finish_01_0900 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_0900 stdResult = ' + data.stdResult) + globalThis.stdResult19 = data.stdResult; + console.log('ACTS_AACommand_finish_01_0900 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_0900 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_0900 : data : ' + JSON.stringify(data)); + globalThis.stdResult20 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_0900 end'); + }) + + await sleep(2000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap' + + ' -s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1200 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_1200 - executeShellCommand: start ') + console.log('ACTS_AACommand_finish_01_1200 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_1200 stdResult = ' + data.stdResult) + globalThis.stdResult21 = data.stdResult; + console.log('ACTS_AACommand_finish_01_1200 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_1200 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_1200 : data : ' + JSON.stringify(data)); + globalThis.stdResult22 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_1200 end'); + }) + + await sleep(2000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + + '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1300 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_1300 - executeShellCommand: start ') + console.log('ACTS_AACommand_finish_01_1300 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_1300 stdResult = ' + data.stdResult) + globalThis.stdResult23 = data.stdResult; + console.log('ACTS_AACommand_finish_01_1300 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_1300 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_1300 : data : ' + JSON.stringify(data)); + globalThis.stdResult24 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_1300 end'); + }) + + await sleep(2000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + + '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1400 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_1400 - executeShellCommand: start ') + console.log('ACTS_AACommand_finish_01_1400 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_1400 stdResult = ' + data.stdResult) + globalThis.stdResult25 = data.stdResult; + console.log('ACTS_AACommand_finish_01_1400 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_1400 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_1400 : data : ' + JSON.stringify(data)); + globalThis.stdResult26 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_1400 end'); + }) + + await sleep(2000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + + '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1500 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_1500 - executeShellCommand: start ') + console.log('ACTS_AACommand_finish_01_1500 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_1500 stdResult = ' + data.stdResult) + globalThis.stdResult27 = data.stdResult; + console.log('ACTS_AACommand_finish_01_1500 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_1500 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_1500 : data : ' + JSON.stringify(data)); + globalThis.stdResult28 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_1500 end'); + }) + + await sleep(2000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + + '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0200 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_0200 - executeShellCommand: start ') + console.log('ACTS_AACommand_finish_01_0200 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_0200 stdResult = ' + data.stdResult) + console.log('ACTS_AACommand_finish_01_0200 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_0200 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_0200 : data : ' + JSON.stringify(data)); + globalThis.stdResult29 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_0200 end'); + }) + + await sleep(2000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + + '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0300 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_0300 - executeShellCommand: start ') + console.log('ACTS_AACommand_finish_01_0300 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_0300 stdResult = ' + data.stdResult) + console.log('ACTS_AACommand_finish_01_0300 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_0300 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_0300 : data : ' + JSON.stringify(data)); + globalThis.stdResult30 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_0300 end'); + }) + + await sleep(2000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + + 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0800 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_0800 - executeShellCommand: start ') + console.log('ACTS_AACommand_finish_01_0800 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_0800 stdResult = ' + data.stdResult) + console.log('ACTS_AACommand_finish_01_0800 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_0800 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_0800 : data : ' + JSON.stringify(data)); + globalThis.stdResult31 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_0800 end'); + }) + + await sleep(2000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + + 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1000 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_1000 - executeShellCommand: start ') + console.log('ACTS_AACommand_finish_01_1000 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_1000 stdResult = ' + data.stdResult) + console.log('ACTS_AACommand_finish_01_1000 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_1000 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_1000 : data : ' + JSON.stringify(data)); + globalThis.stdResult32 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_1000 end'); + }) + + await sleep(2000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + + '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1100 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_1100 - executeShellCommand: start ') + console.log('ACTS_AACommand_finish_01_1100 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_1100 stdResult = ' + data.stdResult) + console.log('ACTS_AACommand_finish_01_1100 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_1100 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_1100 : data : ' + JSON.stringify(data)); + globalThis.stdResult33 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_1100 end'); + }) + + await sleep(2000) + + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap' + + ' -s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1600 -s unittest OpenHarmonyTestRunner' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log('ACTS_AACommand_finish_01_1600 - executeShellCommand: start ') + console.log('ACTS_AACommand_finish_01_1600 start err: ' + JSON.stringify(err)) + console.log('ACTS_AACommand_finish_01_1600 stdResult = ' + data.stdResult) + console.log('ACTS_AACommand_finish_01_1600 - executeShellCommand: end') + }) + + await sleep(3000) + + cmd = 'aa dump -a' + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('ACTS_AACommand_finish_01_1600 : err : ' + JSON.stringify(err)); + console.info('ACTS_AACommand_finish_01_1600 : data : ' + JSON.stringify(data)); + globalThis.stdResult34 = data["stdResult"]; + console.info('ACTS_AACommand_finish_01_1600 end'); + }) + + setTimeout(() => { + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + }, 5000) } onDestroy() { diff --git a/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/pages/index.ets index c8afef08d..be49947b3 100644 --- a/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/pages/index.ets +++ b/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/pages/index.ets @@ -13,493 +13,9 @@ * 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 { - aboutToAppear() { - console.info('MainAbility index aboutToAppear') - console.info('start run testcase!!!') - let cmd: any - let abilityDelegatorArguments: any - let abilityDelegator: any - - function sleep(delay) { - let start = (new Date()).getTime(); - while ((new Date()).getTime() - start < delay) { - continue; - } - } - function test(time) { - sleep(time); - } - - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + - 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0700 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_0700 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_0700 stdResult = ' + data.stdResult) - globalThis.stdResult1 = data.stdResult; - console.log('ACTS_AACommand_finish_01_0700 - executeShellCommand: end ') - }) - - test(3000) - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_0700 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_0700 : data : ' + JSON.stringify(data)); - globalThis.stdResult2 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_0700 end'); - }) - - test(3000) - - cmd = 'aa test -b com.example.aacommandrelyhap -m entry_test -s class ACTS_AACommand_01_3#ACTS_AACo' + - 'mmand_print_01_0100 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_print_01_0100 - executeShellCommand: start ') - console.log('ACTS_AACommand_print_01_0100 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_print_01_0100 stdResult = ' + data.stdResult) - globalThis.stdResult3 = data.stdResult; - console.log('ACTS_AACommand_print_01_0100 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComm' + - 'and_print_01_0200 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_print_01_0200 - executeShellCommand: start ') - console.log('ACTS_AACommand_print_01_0200 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_print_01_0200 stdResult = ' + data.stdResult) - globalThis.stdResult4 = data.stdResult; - console.log('ACTS_AACommand_print_01_0200 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_' + - 'AACommand_print_01_0300 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_print_01_0300 - executeShellCommand: start ') - console.log('ACTS_AACommand_print_01_0300 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_print_01_0300 stdResult = ' + data.stdResult) - globalThis.stdResult5 = data.stdResult; - console.log('ACTS_AACommand_print_01_0300 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComma' + - 'nd_print_01_0400 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_print_01_0400 - executeShellCommand: start ') - console.log('ACTS_AACommand_print_01_0400 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_print_01_0400 stdResult = ' + data.stdResult) - globalThis.stdResult6 = data.stdResult; - console.log('ACTS_AACommand_print_01_0400 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComm' + - 'and_print_01_0500 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_print_01_0500 - executeShellCommand: start ') - console.log('ACTS_AACommand_print_01_0500 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_print_01_0500 stdResult = ' + data.stdResult) - globalThis.stdResult7 = data.stdResult; - console.log('ACTS_AACommand_print_01_0500 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AA' + - 'Command_print_01_0600 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_print_01_0600 - executeShellCommand: start ') - console.log('ACTS_AACommand_print_01_0600 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_print_01_0600 stdResult = ' + data.stdResult) - globalThis.stdResult8 = data.stdResult; - console.log('ACTS_AACommand_print_01_0600 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' + - 'ACTS_AACommand_01_3#ACTS_AACommand_print_01_0700 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_print_01_0700 - executeShellCommand: start ') - console.log('ACTS_AACommand_print_01_0700 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_print_01_0700 stdResult = ' + data.stdResult) - globalThis.stdResult9 = data.stdResult; - console.log('ACTS_AACommand_print_01_0700 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + - 'class ACTS_AACommand_01_3#ACTS_AACommand_print_01_0800 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_print_01_0800 - executeShellCommand: start ') - console.log('ACTS_AACommand_print_01_0800 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_print_01_0800 stdResult = ' + data.stdResult) - globalThis.stdResult10 = data.stdResult; - console.log('ACTS_AACommand_print_01_0800 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' + - 'ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0400 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_0400 - executeShellCommand: start ') - console.log('ACTS_AACommand_finish_01_0400 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_0400 stdResult = ' + data.stdResult) - globalThis.stdResult11 = data.stdResult; - console.log('ACTS_AACommand_finish_01_0400 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_0700 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_0700 : data : ' + JSON.stringify(data)); - globalThis.stdResult12 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_0700 end'); - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + - 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0100 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_0100 - executeShellCommand: start ') - console.log('ACTS_AACommand_finish_01_0100 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_0100 stdResult = ' + data.stdResult) - globalThis.stdResult13 = data.stdResult; - console.log('ACTS_AACommand_finish_01_0100 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_0700 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_0700 : data : ' + JSON.stringify(data)); - globalThis.stdResult14 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_0700 end'); - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' + - 'ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0500 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_0500 - executeShellCommand: start ') - console.log('ACTS_AACommand_finish_01_0500 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_0500 stdResult = ' + data.stdResult) - globalThis.stdResult15 = data.stdResult; - console.log('ACTS_AACommand_finish_01_0500 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_0500 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_0500 : data : ' + JSON.stringify(data)); - globalThis.stdResult16 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_0500 end'); - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + - 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0600 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_0600 - executeShellCommand: start ') - console.log('ACTS_AACommand_finish_01_0600 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_0600 stdResult = ' + data.stdResult) - globalThis.stdResult17 = data.stdResult; - console.log('ACTS_AACommand_finish_01_0600 - executeShellCommand: end') - }) - - test(3000) - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_0600 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_0600 : data : ' + JSON.stringify(data)); - globalThis.stdResult18 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_0600 end'); - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + - 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0900 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_0900 - executeShellCommand: start ') - console.log('ACTS_AACommand_finish_01_0900 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_0900 stdResult = ' + data.stdResult) - globalThis.stdResult19 = data.stdResult; - console.log('ACTS_AACommand_finish_01_0900 - executeShellCommand: end') - }) - - - test(3000) - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_0900 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_0900 : data : ' + JSON.stringify(data)); - globalThis.stdResult20 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_0900 end'); - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap' + - ' -s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1200 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_1200 - executeShellCommand: start ') - console.log('ACTS_AACommand_finish_01_1200 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_1200 stdResult = ' + data.stdResult) - globalThis.stdResult21 = data.stdResult; - console.log('ACTS_AACommand_finish_01_1200 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_1200 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_1200 : data : ' + JSON.stringify(data)); - globalThis.stdResult22 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_1200 end'); - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + - '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1300 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_1300 - executeShellCommand: start ') - console.log('ACTS_AACommand_finish_01_1300 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_1300 stdResult = ' + data.stdResult) - globalThis.stdResult23 = data.stdResult; - console.log('ACTS_AACommand_finish_01_1300 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_1300 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_1300 : data : ' + JSON.stringify(data)); - globalThis.stdResult24 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_1300 end'); - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + - '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1400 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_1400 - executeShellCommand: start ') - console.log('ACTS_AACommand_finish_01_1400 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_1400 stdResult = ' + data.stdResult) - globalThis.stdResult25 = data.stdResult; - console.log('ACTS_AACommand_finish_01_1400 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_1400 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_1400 : data : ' + JSON.stringify(data)); - globalThis.stdResult26 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_1400 end'); - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + - '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1500 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_1500 - executeShellCommand: start ') - console.log('ACTS_AACommand_finish_01_1500 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_1500 stdResult = ' + data.stdResult) - globalThis.stdResult27 = data.stdResult; - console.log('ACTS_AACommand_finish_01_1500 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_1500 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_1500 : data : ' + JSON.stringify(data)); - globalThis.stdResult28 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_1500 end'); - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + - '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0200 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_0200 - executeShellCommand: start ') - console.log('ACTS_AACommand_finish_01_0200 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_0200 stdResult = ' + data.stdResult) - console.log('ACTS_AACommand_finish_01_0200 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_0200 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_0200 : data : ' + JSON.stringify(data)); - globalThis.stdResult29 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_0200 end'); - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + - '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0300 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_0300 - executeShellCommand: start ') - console.log('ACTS_AACommand_finish_01_0300 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_0300 stdResult = ' + data.stdResult) - console.log('ACTS_AACommand_finish_01_0300 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_0300 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_0300 : data : ' + JSON.stringify(data)); - globalThis.stdResult30 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_0300 end'); - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + - 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0800 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_0800 - executeShellCommand: start ') - console.log('ACTS_AACommand_finish_01_0800 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_0800 stdResult = ' + data.stdResult) - console.log('ACTS_AACommand_finish_01_0800 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_0800 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_0800 : data : ' + JSON.stringify(data)); - globalThis.stdResult31 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_0800 end'); - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + - 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1000 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_1000 - executeShellCommand: start ') - console.log('ACTS_AACommand_finish_01_1000 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_1000 stdResult = ' + data.stdResult) - console.log('ACTS_AACommand_finish_01_1000 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_1000 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_1000 : data : ' + JSON.stringify(data)); - globalThis.stdResult32 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_1000 end'); - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + - '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1100 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_1100 - executeShellCommand: start ') - console.log('ACTS_AACommand_finish_01_1100 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_1100 stdResult = ' + data.stdResult) - console.log('ACTS_AACommand_finish_01_1100 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_1100 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_1100 : data : ' + JSON.stringify(data)); - globalThis.stdResult33 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_1100 end'); - }) - - test(3000) - - cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap' + - ' -s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1600 -s unittest OpenHarmonyTestRunner' - globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.log('ACTS_AACommand_finish_01_1600 - executeShellCommand: start ') - console.log('ACTS_AACommand_finish_01_1600 start err: ' + JSON.stringify(err)) - console.log('ACTS_AACommand_finish_01_1600 stdResult = ' + data.stdResult) - console.log('ACTS_AACommand_finish_01_1600 - executeShellCommand: end') - }) - - test(3000) - - cmd = 'aa dump -a' - abilityDelegator.executeShellCommand(cmd, - (err, data) => { - console.info('ACTS_AACommand_finish_01_1600 : err : ' + JSON.stringify(err)); - console.info('ACTS_AACommand_finish_01_1600 : data : ' + JSON.stringify(data)); - globalThis.stdResult34 = data["stdResult"]; - console.info('ACTS_AACommand_finish_01_1600 end'); - }) - - test(3000) - - setTimeout(() => { - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, 12000) - - } @State message: string = 'Hello World' build() { Row() { -- GitLab