提交 94cc751e 编写于 作者: H hu0475

'新增onNewWant测试'

Signed-off-by: Nhu0475 <huyanqiang5@huawei.com>
上级 531e8c3d
......@@ -438,6 +438,49 @@ export default function abilityTest() {
done();
});
/**
*@tc.number : UI_ABILITY_LIFE_CYCLE_TEST_0007
*@tc.name : UIAbilityLifeCycleTest0007
*@tc.desc : start mainability1, after start mainability1 twice, mainability1 is a single ability.
*@tc.size : MediumTest
*@tc.type : Function
*@tc.level : Level 1
*/
it('UI_ABILITY_LIFE_CYCLE_TEST_0007',0, async (done) => {
console.log("------------UI_ABILITY_LIFE_CYCLE_TEST_0007 START-------------");
TAG = "UI_ABILITY_LIFE_CYCLE_TEST_0007";
var want = {
"bundleName": "com.example.uiabilitylifecycle",
"abilityName": "MainAbility1",
"moduleName": moduleName
}
await globalThis.abilityContext.startAbility(want)
.then((data) => {
console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => {
console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error));
})
await sleep(2000);
globalThis.abilityContext.startAbility(want)
.then((data) => {
console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => {
console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error));
})
await sleep(2000);
const result = globalThis.onNewWantStr;
console.info(TAG + 'result: ' + JSON.stringify(result));
expect(result).assertEqual('MainAbility1 onNewWant');
globalThis.ability1context.terminateSelf();
await sleep(500);
done();
})
/**
*@tc.number : UI_Ability_Constant_Test_0100
*@tc.name : UI_Ability_Constant_Test_0100
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册