diff --git a/hiviewdfx/apprecoverytest/src/main/js/TestAbility/app.js b/hiviewdfx/apprecoverytest/src/main/js/TestAbility/app.js index d5ee271df29e516d1c8929054283e5f2bf5c981c..41437d53e8ba5999b0b42f395272164ad25fa07f 100755 --- a/hiviewdfx/apprecoverytest/src/main/js/TestAbility/app.js +++ b/hiviewdfx/apprecoverytest/src/main/js/TestAbility/app.js @@ -15,6 +15,7 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import { Hypium } from '@ohos/hypium' +import featureAbility from '@ohos.ability.featureAbility'; import testsuite from '../test/List.test' export default { @@ -23,6 +24,8 @@ export default { var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() console.info('start run testcase!!!') + let context = featureAbility.getContext(); + globalThis.abilityContext = context; Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) }, onDestroy() {