From 4ed745bacfd084fe4adc4d56a7a1af462cf47128 Mon Sep 17 00:00:00 2001 From: xinking129 Date: Mon, 17 Jul 2023 19:38:01 +0800 Subject: [PATCH] change code Signed-off-by: xinking129 --- .../ActsNFCSelectTypesTest/Test.json | 2 ++ .../entry/src/main/ets/test/Ability.test.ets | 24 +++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTest/Test.json b/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTest/Test.json index c72c2c6c8..086df90fa 100644 --- a/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTest/Test.json +++ b/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTest/Test.json @@ -12,10 +12,12 @@ { "test-file-name": [ "ActsNFCSelectTypesTest.hap", + "ActsNFCSelectTypesTestRelyFifth.hap", "ActsNFCSelectTypesTestRelyFirst.hap", "ActsNFCSelectTypesTestRelyFourth.hap", "ActsNFCSelectTypesTestRelyMultiAbility.hap", "ActsNFCSelectTypesTestRelyMultiHapFirst.hap", + "ActsNFCSelectTypesTestRelyMultiHapFourth.hap", "ActsNFCSelectTypesTestRelyMultiHapSecond.hap", "ActsNFCSelectTypesTestRelyMultiHapThird.hap", "ActsNFCSelectTypesTestRelySecond.hap", diff --git a/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTest/entry/src/main/ets/test/Ability.test.ets index ac4ffdb5a..bf4c70537 100644 --- a/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTest/entry/src/main/ets/test/Ability.test.ets @@ -519,7 +519,7 @@ export default function abilityTest() { }).catch(err => { console.log('pkill -f err is ' + JSON.stringify(err)) }); - },1000) + },5000) await sleep(1000); setTimeout(()=> { globalThis.abilitycontext.startAbility( @@ -527,11 +527,19 @@ export default function abilityTest() { if (err.code) { console.error(`startAbility failed, code is ${err.code}, message is ${err.message}`); expect(true).assertFalse(); + done(); return; } console.info('startAbility succeed'); expect(true).assertTrue(); - done(); + setTimeout(()=> { + abilityDelegator.executeShellCommand('pkill -f com.example.mytest5').then(data => { + console.log('pkill -f successful ' + JSON.stringify(data)) + }).catch(err => { + console.log('pkill -f err is ' + JSON.stringify(err)) + }); + done(); + },1000) }); },1000) @@ -569,17 +577,25 @@ export default function abilityTest() { }).catch(err => { console.log('pkill -f err is ' + JSON.stringify(err)) }); - },1000) + },5000) globalThis.abilitycontext.startAbility( want, (err) => { if (err.code) { console.error(`startAbility failed, code is ${err.code}, message is ${err.message}`); expect(true).assertFalse(); + done(); return; } console.info('startAbility succeed'); expect(true).assertTrue(); - done(); + setTimeout(()=> { + abilityDelegator.executeShellCommand('pkill -f com.example.mytest5').then(data => { + console.log('pkill -f successful ' + JSON.stringify(data)) + }).catch(err => { + console.log('pkill -f err is ' + JSON.stringify(err)) + }); + done(); + },1000) }); }) }) -- GitLab