diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets index 4d53d13b00964c93a4416e0771a9938fac3ac35d..a617984f79d257d557d97226e52e1da2befd4634 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByAbility.test.ets @@ -379,17 +379,18 @@ export default function getProfileByAbility() { /* * @tc.number: getProfileByAbility_2200 * @tc.name: getProfileByAbility : The profile is obtained by specified ability - * @tc.desc: profile is not json-format (by promise) + * @tc.desc: profile is .txt (by promise) * @tc.level 0 */ it('getProfileByAbility_2200', 0, async function (done) { await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3).then(data => { console.info('[getProfileByAbility_2200] getApplicationInfo callback data is: ' + JSON.stringify(data)); - expect(data).assertFail() + expect(Array.isArray(data)).assertTrue(); + expect(typeof data[0]).assertEqual("string"); done(); }).catch(err => { console.error('[getProfileByAbility_2200]Operation failed. Cause: ' + JSON.stringify(err)); - expect(err).assertEqual(1); + expect().assertFail(); done(); }) }) @@ -397,18 +398,18 @@ export default function getProfileByAbility() { /* * @tc.number: getProfileByAbility_2300 * @tc.name: getProfileByAbility : The profile is obtained by specified ability - * @tc.desc: profile is not json-format (by callback) + * @tc.desc: profile is .txt (by callback) * @tc.level 0 */ it('getProfileByAbility_2300', 0, async function (done) { bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3, (err, data) => { if (err) { console.error('[getProfileByAbility_2300]Operation failed. Cause: ' + JSON.stringify(err)); - expect(err).assertEqual(1); + expect().assertFail(); } console.info('[getProfileByAbility_2300] getApplicationInfo callback data is: ' + JSON.stringify(data)); - expect(typeof data).assertEqual("string"); - expect(data).assertEqual("GetProfile failed"); + expect(Array.isArray(data)).assertTrue(); + expect(typeof data[0]).assertEqual("string"); done(); }); }) diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets index 1f96904892aaf4470b4f4084c14c9944265b215f..65d7a3bf0b041d435892f4e196fdf70eb4eaec68 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsstageetstest/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets @@ -379,17 +379,18 @@ export default function getProfileByExtensionAbility() { /* * @tc.number: getProfileByExtensionAbility_2200 * @tc.name: getProfileByExtensionAbility : The profile is obtained by specified ability - * @tc.desc: profile is not json-format (by promise) + * @tc.desc: profile is .txt (by promise) * @tc.level 0 */ it('getProfileByExtensionAbility_2200', 0, async function (done) { await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3).then(data => { console.info('[getProfileByExtensionAbility_2200] getApplicationInfo callback data is: ' + JSON.stringify(data)); - expect(data).assertFail() + expect(Array.isArray(data)).assertTrue(); + expect(typeof data[0]).assertEqual("string"); done(); }).catch(err => { console.error('[getProfileByExtensionAbility_2200]Operation failed. Cause: ' + JSON.stringify(err)); - expect(err).assertEqual(1); + expect().assertFail(); done(); }) }) @@ -397,18 +398,18 @@ export default function getProfileByExtensionAbility() { /* * @tc.number: getProfileByExtensionAbility_2300 * @tc.name: getProfileByExtensionAbility : The profile is obtained by specified ability - * @tc.desc: profile is not json-format (by callback) + * @tc.desc: profile is .txt (by callback) * @tc.level 0 */ it('getProfileByExtensionAbility_2300', 0, async function (done) { bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3, (err, data) => { if (err) { console.error('[getProfileByExtensionAbility_2300]Operation failed. Cause: ' + JSON.stringify(err)); - expect(err).assertEqual(1); + expect().assertFail(); } console.info('[getProfileByExtensionAbility_2300] getApplicationInfo callback data is: ' + JSON.stringify(data)); - expect(typeof data).assertEqual("string"); - expect(data).assertEqual("GetProfile failed"); + expect(Array.isArray(data)).assertTrue(); + expect(typeof data[0]).assertEqual("string"); done(); }); })