提交 250846a8 编写于 作者: C chengxingzhen

XTS元能力失败用例适配

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 ff6f01eb
...@@ -1015,7 +1015,6 @@ describe('ActsFeatureAbilityTest', function () { ...@@ -1015,7 +1015,6 @@ describe('ActsFeatureAbilityTest', function () {
await sleep(1000) await sleep(1000)
}) })
// checkAppType
function checkAppType(info) { function checkAppType(info) {
console.info("AppType : " + info); console.info("AppType : " + info);
expect(typeof (info)).assertEqual("string"); expect(typeof (info)).assertEqual("string");
...@@ -1029,10 +1028,9 @@ describe('ActsFeatureAbilityTest', function () { ...@@ -1029,10 +1028,9 @@ describe('ActsFeatureAbilityTest', function () {
*/ */
it('ACTS_GetAppType_0100', 0, async function (done) { it('ACTS_GetAppType_0100', 0, async function (done) {
await featureAbility.getContext().getAppType().then((data)=>{ await featureAbility.getContext().getAppType().then((data)=>{
checkAppType(data);
console.info("ACTS_GetAppType_0100 getAppType info :" + JSON.stringify(data)) console.info("ACTS_GetAppType_0100 getAppType info :" + JSON.stringify(data))
checkAppType(data);
console.info('====> ACTS_GetAppType_0100 end=====>') console.info('====> ACTS_GetAppType_0100 end=====>')
done();
}).catch((err)=>{ }).catch((err)=>{
console.info('====> ACTS_GetAppType_0100 err=====>' + JSON.stringify(err)) console.info('====> ACTS_GetAppType_0100 err=====>' + JSON.stringify(err))
expect().assertFail() expect().assertFail()
...@@ -1046,22 +1044,18 @@ describe('ActsFeatureAbilityTest', function () { ...@@ -1046,22 +1044,18 @@ describe('ActsFeatureAbilityTest', function () {
* @tc.desc: Check the return value of the interface (by AsyncCallback) * @tc.desc: Check the return value of the interface (by AsyncCallback)
*/ */
it('ACTS_GetAppType_0200', 0, async function (done) { it('ACTS_GetAppType_0200', 0, async function (done) {
let tempInfo;
featureAbility.getContext().getAppType((err, data) => { featureAbility.getContext().getAppType((err, data) => {
if(err.code != 0){ if(err.code != 0){
console.info("ACTS_GetAppType_0200 getAppType callback err :" + JSON.stringify(err))
expect().assertFail() expect().assertFail()
done() done()
}else{ }else{
tempInfo = data console.info("ACTS_GetAppType_0200 getAppType callback data :" + JSON.stringify(data))
checkAppType(data)
done()
} }
}); });
console.info("ACTS_GetAppType_0200 getAppType callback info :" + JSON.stringify(tempInfo)) await sleep(1000)
setTimeout(function () {
console.info('====> ACTS_GetAppType_0200 =====>' + JSON.stringify(tempInfo))
checkAppType(tempInfo);
console.info('====> ACTS_GetAppType_0200 =====>')
done()
}, TIMEOUT)
}) })
// checkAbilityInfo // checkAbilityInfo
...@@ -1179,7 +1173,7 @@ describe('ActsFeatureAbilityTest', function () { ...@@ -1179,7 +1173,7 @@ describe('ActsFeatureAbilityTest', function () {
// checkHapModuleInfo // checkHapModuleInfo
function checkHapModuleInfo(data) { function checkHapModuleInfo(data) {
console.info("checkHapModuleInfo start " + data); console.info("checkHapModuleInfo start " + JSON.stringify(data));
expect(typeof (data)).assertEqual("object"); expect(typeof (data)).assertEqual("object");
expect(typeof (data.name)).assertEqual("string"); expect(typeof (data.name)).assertEqual("string");
expect(typeof (data.description)).assertEqual("string"); expect(typeof (data.description)).assertEqual("string");
...@@ -1192,7 +1186,7 @@ describe('ActsFeatureAbilityTest', function () { ...@@ -1192,7 +1186,7 @@ describe('ActsFeatureAbilityTest', function () {
expect(typeof (data.supportedModes)).assertEqual("number"); expect(typeof (data.supportedModes)).assertEqual("number");
expect(Array.isArray(data.reqCapabilities)).assertEqual(true); expect(Array.isArray(data.reqCapabilities)).assertEqual(true);
expect(Array.isArray(data.deviceTypes)).assertEqual(true); expect(Array.isArray(data.deviceTypes)).assertEqual(true);
expect(Array.isArray(data.abilityInfos)).assertEqual(true); expect(Array.isArray(data.abilityInfo)).assertEqual(true);
expect(typeof (data.moduleName)).assertEqual("string"); expect(typeof (data.moduleName)).assertEqual("string");
expect(typeof (data.mainAbilityName)).assertEqual("string"); expect(typeof (data.mainAbilityName)).assertEqual("string");
expect(typeof (data.installationFree)).assertEqual("boolean"); expect(typeof (data.installationFree)).assertEqual("boolean");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册