提交 95eba58a 编写于 作者: C chengxingzhen

xts失败用例适配

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 6508cfef
...@@ -19,11 +19,11 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry ...@@ -19,11 +19,11 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
export default function connectAbilityTest_PA() { export default function connectAbilityTest_PA() {
var TAG = ""; let TAG = "";
var dataAssert = ""; let dataAssert = "";
var abilityDelegator = undefined let abilityDelegator = undefined
var subscriber; let subscriber;
var subscribeInfo = { let subscribeInfo = {
events: ["service_event", "service2_event", "service3_event", "service4_event", "service5_event", events: ["service_event", "service2_event", "service3_event", "service4_event", "service5_event",
"service6_event", "service7_event", "service8_event", "service9_event", "service10_event", "service11_event"] "service6_event", "service7_event", "service8_event", "service9_event", "service10_event", "service11_event"]
}; };
...@@ -43,7 +43,7 @@ export default function connectAbilityTest_PA() { ...@@ -43,7 +43,7 @@ export default function connectAbilityTest_PA() {
} }
function checkParameters(msg1, data) { function checkParameters(msg1, data) {
for (var key in data.parameters) { for (let key in data.parameters) {
console.info(msg1 + " data.parameters is : " + data.parameters[key]) console.info(msg1 + " data.parameters is : " + data.parameters[key])
if (data.parameters[key] === "onFailed") { if (data.parameters[key] === "onFailed") {
dataAssert = "onFailed"; dataAssert = "onFailed";
...@@ -114,24 +114,24 @@ export default function connectAbilityTest_PA() { ...@@ -114,24 +114,24 @@ export default function connectAbilityTest_PA() {
commonEvent.createSubscriber(subscribeInfo, CreateSubscriberCallBack); commonEvent.createSubscriber(subscribeInfo, CreateSubscriberCallBack);
await sleep(2000); await sleep(2000);
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var cmd = "bm install -p data/test/MockService.hap"; let cmd = "bm install -p data/test/MockService.hap";
console.info("cmd : " + cmd) console.info("cmd : " + cmd)
abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => { abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => {
console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
}) })
await sleep(500); await sleep(500);
var cmd1 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry"; let cmd1 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry";
abilityDelegator.executeShellCommand(cmd1, (err: any, d: any) => { abilityDelegator.executeShellCommand(cmd1, (err: any, d: any) => {
console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
}) })
await sleep(500); await sleep(500);
var cmd2 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files"; let cmd2 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
abilityDelegator.executeShellCommand(cmd2, (err: any, d: any) => { abilityDelegator.executeShellCommand(cmd2, (err: any, d: any) => {
console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
}) })
await sleep(500); await sleep(500);
var cmdum = "bm uninstall -n com.example.different.hmservice"; let cmdum = "bm uninstall -n com.example.different.hmservice";
abilityDelegator.executeShellCommand(cmdum, (err: any, d: any) => { abilityDelegator.executeShellCommand(cmdum, (err: any, d: any) => {
console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
done(); done();
...@@ -141,14 +141,13 @@ export default function connectAbilityTest_PA() { ...@@ -141,14 +141,13 @@ export default function connectAbilityTest_PA() {
afterEach(async function (done) { afterEach(async function (done) {
console.info("FreeInstall_FA_ConnectAbility_PA after each called"); console.info("FreeInstall_FA_ConnectAbility_PA after each called");
dataAssert = "" dataAssert = ""
await sleep(1000);
if ("FreeInstall_FA_ConnectAbility_PA_1100" === TAG) { if ("FreeInstall_FA_ConnectAbility_PA_1100" === TAG) {
var cmd14 = "bm uninstall -n com.ohos.hag.famanager"; let cmd14 = "bm uninstall -n com.ohos.hag.famanager";
abilityDelegator.executeShellCommand(cmd14, (err: any, d: any) => { abilityDelegator.executeShellCommand(cmd14, (err: any, d: any) => {
console.info("executeShellCommand14 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); console.info("executeShellCommand14 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
}) })
} }
await sleep(500); await sleep(1500);
done(); done();
}); });
...@@ -161,24 +160,24 @@ export default function connectAbilityTest_PA() { ...@@ -161,24 +160,24 @@ export default function connectAbilityTest_PA() {
it("FreeInstall_FA_ConnectAbility_PA_0100", 0, async function (done) { it("FreeInstall_FA_ConnectAbility_PA_0100", 0, async function (done) {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_0100-------------"); console.log("------------start FreeInstall_FA_ConnectAbility_PA_0100-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_0100"; TAG = "FreeInstall_FA_ConnectAbility_PA_0100";
var cmdmyapp7 = "cp data/test/ConnectFaMyApplication7.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + let cmdmyapp7 = "cp data/test/ConnectFaMyApplication7.hap /data/app/el2/100/base/com.ohos.hag.famanager/" +
"haps/entry/files"; "haps/entry/files";
abilityDelegator.executeShellCommand(cmdmyapp7, (err: any, d: any) => { abilityDelegator.executeShellCommand(cmdmyapp7, (err: any, d: any) => {
console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
}) })
setTimeout(async () => { let str1 = {
var str1 = {
"want": { "want": {
"bundleName": "com.example.myapplication.hmservice", "bundleName": "com.example.myapplication.hmservice",
"abilityName": "com.example.myapplication.ServiceAbility", "abilityName": "com.example.myapplication.ServiceAbility",
} }
}; };
startService(TAG, str1); startService(TAG, str1);
setTimeout(() => {
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onConnect"); expect(dataAssert).assertEqual("onConnect");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0100-------------"); console.log("------------end FreeInstall_FA_ConnectAbility_PA_0100-------------");
}, 4000);
done(); done();
}, 4000);
}); });
/* /*
...@@ -190,23 +189,24 @@ export default function connectAbilityTest_PA() { ...@@ -190,23 +189,24 @@ export default function connectAbilityTest_PA() {
it("FreeInstall_FA_ConnectAbility_PA_0200", 0, async function (done) { it("FreeInstall_FA_ConnectAbility_PA_0200", 0, async function (done) {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_0200-------------"); console.log("------------start FreeInstall_FA_ConnectAbility_PA_0200-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_0200"; TAG = "FreeInstall_FA_ConnectAbility_PA_0200";
var cmdapp9 = "bm install -p data/test/ConnectFaMyApplication9.hap"; let cmdapp9 = "bm install -p data/test/ConnectFaMyApplication9.hap";
abilityDelegator.executeShellCommand(cmdapp9, (err: any, d: any) => { abilityDelegator.executeShellCommand(cmdapp9, (err: any, d: any) => {
console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
}) })
setTimeout(async () => { await sleep(2000)
var str2 = { let str2 = {
"want": { "want": {
"bundleName": "com.example.myapplication.hmservice", "bundleName": "com.example.myapplication.hmservice",
"abilityName": "com.example.myapplication.ServiceAbility2", "abilityName": "com.example.myapplication.ServiceAbility2",
} }
}; };
startService(TAG, str2); startService(TAG, str2);
setTimeout(() => {
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onConnect"); expect(dataAssert).assertEqual("onConnect");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0200-------------"); console.log("------------end FreeInstall_FA_ConnectAbility_PA_0200-------------");
}, 4000);
done(); done();
}, 4000);
}); });
/* /*
...@@ -218,19 +218,19 @@ export default function connectAbilityTest_PA() { ...@@ -218,19 +218,19 @@ export default function connectAbilityTest_PA() {
it("FreeInstall_FA_ConnectAbility_PA_0300", 0, async function (done) { it("FreeInstall_FA_ConnectAbility_PA_0300", 0, async function (done) {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_0300-------------"); console.log("------------start FreeInstall_FA_ConnectAbility_PA_0300-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_0300"; TAG = "FreeInstall_FA_ConnectAbility_PA_0300";
setTimeout(async () => { let str3 = {
var str3 = {
"want": { "want": {
"bundleName": "com.example.myapplication.hmservice", "bundleName": "com.example.myapplication.hmservice",
"abilityName": "com.example.myapplication.ServiceAbility3", "abilityName": "com.example.myapplication.ServiceAbility3",
} }
}; };
startService(TAG, str3); startService(TAG, str3);
setTimeout(() => {
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onFailed"); expect(dataAssert).assertEqual("onFailed");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0300-------------"); console.log("------------end FreeInstall_FA_ConnectAbility_PA_0300-------------");
}, 4000);
done(); done();
}, 4000);
}); });
/* /*
...@@ -241,20 +241,20 @@ export default function connectAbilityTest_PA() { ...@@ -241,20 +241,20 @@ export default function connectAbilityTest_PA() {
*/ */
it("FreeInstall_FA_ConnectAbility_PA_0400", 0, async function (done) { it("FreeInstall_FA_ConnectAbility_PA_0400", 0, async function (done) {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_0400-------------"); console.log("------------start FreeInstall_FA_ConnectAbility_PA_0400-------------");
setTimeout(async () => {
TAG = "FreeInstall_FA_ConnectAbility_PA_0400"; TAG = "FreeInstall_FA_ConnectAbility_PA_0400";
var str4 = { let str4 = {
"want": { "want": {
"bundleName": "com.example.myapplication.hmservice", "bundleName": "com.example.myapplication.hmservice",
"abilityName": "com.example.myapplication.ServiceAbility4", "abilityName": "com.example.myapplication.ServiceAbility4",
} }
}; };
startService(TAG, str4); startService(TAG, str4);
setTimeout(() => {
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onFailed"); expect(dataAssert).assertEqual("onFailed");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0400-------------"); console.log("------------end FreeInstall_FA_ConnectAbility_PA_0400-------------");
}, 4000);
done(); done();
}, 4000);
}); });
/* /*
...@@ -266,23 +266,24 @@ export default function connectAbilityTest_PA() { ...@@ -266,23 +266,24 @@ export default function connectAbilityTest_PA() {
it("FreeInstall_FA_ConnectAbility_PA_0500", 0, async function (done) { it("FreeInstall_FA_ConnectAbility_PA_0500", 0, async function (done) {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_0500-------------"); console.log("------------start FreeInstall_FA_ConnectAbility_PA_0500-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_0500"; TAG = "FreeInstall_FA_ConnectAbility_PA_0500";
var cmdin = "bm install -p data/test/ConnectDifferentApplication.hap"; let cmdin = "bm install -p data/test/ConnectDifferentApplication.hap";
abilityDelegator.executeShellCommand(cmdin, (err: any, d: any) => { abilityDelegator.executeShellCommand(cmdin, (err: any, d: any) => {
console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
}) })
setTimeout(async () => { await sleep(2000)
var str5 = { let str5 = {
"want": { "want": {
"bundleName": "com.example.myapplication.hmservice", "bundleName": "com.example.myapplication.hmservice",
"abilityName": "com.example.myapplication.ServiceAbility5", "abilityName": "com.example.myapplication.ServiceAbility5",
} }
}; };
startService(TAG, str5); startService(TAG, str5);
setTimeout(() => {
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onConnect"); expect(dataAssert).assertEqual("onConnect");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0500-------------"); console.log("------------end FreeInstall_FA_ConnectAbility_PA_0500-------------");
}, 4000);
done(); done();
}, 4000);
}); });
/* /*
...@@ -294,19 +295,19 @@ export default function connectAbilityTest_PA() { ...@@ -294,19 +295,19 @@ export default function connectAbilityTest_PA() {
it("FreeInstall_FA_ConnectAbility_PA_0600", 0, async function (done) { it("FreeInstall_FA_ConnectAbility_PA_0600", 0, async function (done) {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_0600-------------"); console.log("------------start FreeInstall_FA_ConnectAbility_PA_0600-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_0600"; TAG = "FreeInstall_FA_ConnectAbility_PA_0600";
setTimeout(async () => { let str6 = {
var str6 = {
"want": { "want": {
"bundleName": "com.example.myapplication.hmservice", "bundleName": "com.example.myapplication.hmservice",
"abilityName": "com.example.myapplication.ServiceAbility6", "abilityName": "com.example.myapplication.ServiceAbility6",
} }
}; };
startService(TAG, str6); startService(TAG, str6);
setTimeout(() => {
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onFailed"); expect(dataAssert).assertEqual("onFailed");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0600-------------"); console.log("------------end FreeInstall_FA_ConnectAbility_PA_0600-------------");
}, 4000);
done(); done();
}, 4000);
}); });
/* /*
...@@ -319,19 +320,19 @@ export default function connectAbilityTest_PA() { ...@@ -319,19 +320,19 @@ export default function connectAbilityTest_PA() {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_0700-------------"); console.log("------------start FreeInstall_FA_ConnectAbility_PA_0700-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_0700"; TAG = "FreeInstall_FA_ConnectAbility_PA_0700";
setTimeout(async () => { let str7 = {
var str7 = {
"want": { "want": {
"bundleName": "com.example.myapplication.hmservice", "bundleName": "com.example.myapplication.hmservice",
"abilityName": "com.example.myapplication.ServiceAbility7", "abilityName": "com.example.myapplication.ServiceAbility7",
} }
}; };
startService(TAG, str7); startService(TAG, str7);
setTimeout(() => {
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onFailed"); expect(dataAssert).assertEqual("onFailed");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0700-------------"); console.log("------------end FreeInstall_FA_ConnectAbility_PA_0700-------------");
}, 4000);
done(); done();
}, 4000);
}); });
/* /*
...@@ -344,19 +345,19 @@ export default function connectAbilityTest_PA() { ...@@ -344,19 +345,19 @@ export default function connectAbilityTest_PA() {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_0800-------------"); console.log("------------start FreeInstall_FA_ConnectAbility_PA_0800-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_0800"; TAG = "FreeInstall_FA_ConnectAbility_PA_0800";
setTimeout(async () => { let str8 = {
var str8 = {
"want": { "want": {
"bundleName": "com.example.myapplication.hmservice", "bundleName": "com.example.myapplication.hmservice",
"abilityName": "com.example.myapplication.ServiceAbility8", "abilityName": "com.example.myapplication.ServiceAbility8",
} }
}; };
startService(TAG, str8); startService(TAG, str8);
setTimeout(() => {
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onFailed"); expect(dataAssert).assertEqual("onFailed");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0800-------------"); console.log("------------end FreeInstall_FA_ConnectAbility_PA_0800-------------");
}, 4000);
done(); done();
}, 4000);
}); });
/* /*
...@@ -368,25 +369,25 @@ export default function connectAbilityTest_PA() { ...@@ -368,25 +369,25 @@ export default function connectAbilityTest_PA() {
it("FreeInstall_FA_ConnectAbility_PA_0900", 0, async function (done) { it("FreeInstall_FA_ConnectAbility_PA_0900", 0, async function (done) {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_0900-------------"); console.log("------------start FreeInstall_FA_ConnectAbility_PA_0900-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_0900"; TAG = "FreeInstall_FA_ConnectAbility_PA_0900";
var cmdrm = "rm -r /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/*"; let cmdrm = "rm -r /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/*";
abilityDelegator.executeShellCommand(cmdrm, (err: any, d: any) => { abilityDelegator.executeShellCommand(cmdrm, (err: any, d: any) => {
console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
}) })
setTimeout(async () => {
await sleep(500); await sleep(500);
var str9 = { let str9 = {
"want": { "want": {
"bundleName": "com.example.myapplication.hmservice", "bundleName": "com.example.myapplication.hmservice",
"abilityName": "com.example.myapplication.ServiceAbility9", "abilityName": "com.example.myapplication.ServiceAbility9",
} }
}; };
startService(TAG, str9); startService(TAG, str9);
setTimeout(() => {
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onFailed"); expect(dataAssert).assertEqual("onFailed");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0900-------------"); console.log("------------end FreeInstall_FA_ConnectAbility_PA_0900-------------");
}, 4000);
done(); done();
}, 4000);
}); });
/* /*
...@@ -399,19 +400,19 @@ export default function connectAbilityTest_PA() { ...@@ -399,19 +400,19 @@ export default function connectAbilityTest_PA() {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_1000-------------"); console.log("------------start FreeInstall_FA_ConnectAbility_PA_1000-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_1000"; TAG = "FreeInstall_FA_ConnectAbility_PA_1000";
setTimeout(async () => { let str10 = {
var str10 = {
"want": { "want": {
"bundleName": "com.example.myapplication.hmservice", "bundleName": "com.example.myapplication.hmservice",
"abilityName": "com.example.myapplication.ServiceAbility10", "abilityName": "com.example.myapplication.ServiceAbility10",
} }
}; };
startService(TAG, str10); startService(TAG, str10);
setTimeout(() => {
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onFailed"); expect(dataAssert).assertEqual("onFailed");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_1000-------------"); console.log("------------end FreeInstall_FA_ConnectAbility_PA_1000-------------");
}, 4000);
done(); done();
}, 4000);
}); });
/* /*
...@@ -423,25 +424,24 @@ export default function connectAbilityTest_PA() { ...@@ -423,25 +424,24 @@ export default function connectAbilityTest_PA() {
it("FreeInstall_FA_ConnectAbility_PA_1100", 0, async function (done) { it("FreeInstall_FA_ConnectAbility_PA_1100", 0, async function (done) {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_1100-------------"); console.log("------------start FreeInstall_FA_ConnectAbility_PA_1100-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_1100"; TAG = "FreeInstall_FA_ConnectAbility_PA_1100";
var cmdmyapp8 = "cp data/test/ConnectFaMyApplication8.hap /data/app/el2/100/base/com.ohos.hag.famanager/" + let cmdmyapp8 = "cp data/test/ConnectFaMyApplication8.hap /data/app/el2/100/base/com.ohos.hag.famanager/" +
"haps/entry/files"; "haps/entry/files";
abilityDelegator.executeShellCommand(cmdmyapp8, (err: any, d: any) => { abilityDelegator.executeShellCommand(cmdmyapp8, (err: any, d: any) => {
console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
}) })
let str11 = {
setTimeout(async () => {
var str11 = {
"want": { "want": {
"bundleName": "com.example.myapplication.hmservice", "bundleName": "com.example.myapplication.hmservice",
"abilityName": "com.example.myapplication.ServiceAbility11", "abilityName": "com.example.myapplication.ServiceAbility11",
} }
}; };
startService(TAG, str11); startService(TAG, str11);
setTimeout(() => {
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert)); console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onConnect"); expect(dataAssert).assertEqual("onConnect");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_1100-------------"); console.log("------------end FreeInstall_FA_ConnectAbility_PA_1100-------------");
done()
}, 4000); }, 4000);
done();
}); });
} }
) )
......
...@@ -772,7 +772,7 @@ export default function StartAbilityForResult() { ...@@ -772,7 +772,7 @@ export default function StartAbilityForResult() {
/* /*
* @tc.number: FreeInstall_FA_StartAbilityForResult_1900 * @tc.number: FreeInstall_FA_StartAbilityForResult_1900
* @tc.name: startAbilityForResult: yuanzihua already installed,input wrong flags('11'),start successfully. * @tc.name: startAbilityForResult: yuanzihua already installed,input wrong flags('11'),start failed.
* @tc.desc: Function test * @tc.desc: Function test
* @tc.level 0 * @tc.level 0
*/ */
...@@ -800,14 +800,14 @@ export default function StartAbilityForResult() { ...@@ -800,14 +800,14 @@ export default function StartAbilityForResult() {
} }
await featureAbility.startAbilityForResult(startAbilityParameter) await featureAbility.startAbilityForResult(startAbilityParameter)
.then((data) => { .then((data) => {
details = data;
console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data)) console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
}).catch((error) => { }).catch((error) => {
details = error;
console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error)); console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
}) })
await Utils.sleep(2000); await Utils.sleep(2000);
console.log(TAG + " resultCode: " + details.resultCode); console.log(TAG + " errorCode: " + details.code);
expect(details.resultCode).assertEqual(1); expect(details.code).assertEqual(1);
done(); done();
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册