From 3e3c5ee97487e25a28fe8c974108deef04f42c78 Mon Sep 17 00:00:00 2001 From: SoftSquirrel Date: Tue, 30 Aug 2022 21:13:44 +0800 Subject: [PATCH] Issue: #I5NDLC Description: change GetMediaById to GetMediaDataById Sig: SIG_ApplicaitonFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: SoftSquirrel --- .../main/ets/test/GetProfileByAbility.test.ets | 15 ++++++++------- .../test/GetProfileByExtensionAbility.test.ets | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) 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 4d53d13b0..a617984f7 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 1f9690489..65d7a3bf0 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(); }); }) -- GitLab