!619 【ability】【master】DMS_dcts测试套适配新设备以及新增用例

Merge pull request !619 from zhaominjie11/master
This commit is contained in:
openharmony_ci 2024-04-12 02:43:02 +00:00 committed by Gitee
commit 0e75735080
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
10 changed files with 168 additions and 10 deletions

View File

@ -20,7 +20,8 @@
"srcPath":"",
"deviceType": [
"default",
"tablet"
"tablet",
"2in1"
],
"distro": {
"deliveryWithInstall": true,

View File

@ -913,7 +913,7 @@ export default function dmsJsUnitTest() {
want: wantValue
}).then((data) => {
console.info('SUB_DMS_StandardOs_collaboration_Startability_StartRemoteAbility_3500 data' + JSON.stringify(data));
expect(data == 0).assertTrue();
expect(JSON.stringify(data) == 0).assertTrue();
done();
}).catch((err) => {
console.info('SUB_DMS_StandardOs_collaboration_Startability_StartRemoteAbility_3500 err: ' + err.code);

View File

@ -20,7 +20,8 @@
"srcPath":"",
"deviceType": [
"default",
"tablet"
"tablet",
"2in1"
],
"distro": {
"deliveryWithInstall": true,

View File

@ -769,6 +769,131 @@ export default function DmsFwkFaTest() {
console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0300 is end---------------");
});
/*
* @tc.number SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0400
* @tc.name StartRemoteAbilityForResult remote MainAbility want is null
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0400", 0, async function (done) {
console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0400 is start---------------");
let TAG = 'SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0400';
let wantValue = {
}
featureAbility.startAbilityForResult({
want: wantValue
}, (error) => {
if (error && error.code !== 0) {
console.error(TAG + ' fail, error: ' + error.code);
expect(error.code).assertEqual(1);
} else {
console.log(TAG + ' StartAbilityForResult_callback success');
expect().assertFail()
}
});
done();
await sleep(1000);
console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0400 is end---------------");
});
/*
* @tc.number SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0500
* @tc.name StartRemoteAbilityForResult remote MainAbility abilityName is undefined
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0500", 0, async function (done) {
console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0500 is start---------------");
let TAG = 'SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0500';
let wantValue = {
deviceId: dvId,
bundleName: "com.acts.example.dmsfwkstageserver",
abilityName: undefined,
parameters: {
startReason: "terminateSelfWithResult"
}
}
featureAbility.startAbilityForResult({
want: wantValue
}, (error) => {
if (error && error.code !== 0) {
console.error(TAG + ' fail, error: ' + error.code);
expect(error.code).assertEqual(1);
} else {
console.log(TAG + ' StartAbilityForResult_callback success');
expect().assertFail()
}
});
done();
await sleep(1000);
console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0500 is end---------------");
});
/*
* @tc.number SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0600
* @tc.name StartRemoteAbilityForResult remote MainAbility abilityName is null
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0600", 0, async function (done) {
console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0600 is start---------------");
let TAG = 'SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0600';
let wantValue = {
deviceId: dvId,
bundleName: "com.acts.example.dmsfwkstageserver",
abilityName: null,
parameters: {
startReason: "terminateSelfWithResult"
}
}
featureAbility.startAbilityForResult({
want: wantValue
}, (error) => {
if (error && error.code !== 0) {
console.error(TAG + ' fail, error: ' + error.code);
expect(error.code).assertEqual(1);
} else {
console.log(TAG + ' StartAbilityForResult_callback success');
expect().assertFail()
}
});
done();
await sleep(1000);
console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0600 is end---------------");
});
/*
* @tc.number SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0700
* @tc.name StartRemoteAbilityForResult remote MainAbility abilityName is err
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0700", 0, async function (done) {
console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0700 is start---------------");
let TAG = 'SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0700';
let wantValue = {
deviceId: dvId,
bundleName: "com.acts.example.dmsfwkstageserver",
abilityName: 's1234wersds',
parameters: {
startReason: "terminateSelfWithResult"
}
}
featureAbility.startAbilityForResult({
want: wantValue
}, (error) => {
if (error && error.code !== 0) {
console.error(TAG + ' fail, error: ' + error.code);
expect(error.code).assertEqual(9);
} else {
console.log(TAG + ' StartAbilityForResult_callback success');
expect().assertFail()
}
});
done();
await sleep(1000);
console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0700 is end---------------");
});
/*
* @tc.number SUB_DMS_StandardOs_collaboration_connetability_connectRemoteAbility_1300

View File

@ -33,7 +33,7 @@
"deviceType": [
"tablet",
"default",
"phone"
"2in1"
],
"distro": {
"deliveryWithInstall": true,

View File

@ -7,7 +7,8 @@
"mainElement": "MainAbility",
"deviceTypes": [
"default",
"tablet"
"tablet",
"2in1"
],
"deliveryWithInstall": true,
"installationFree": false,

View File

@ -7,7 +7,8 @@
"mainElement": "MainAbility",
"deviceTypes": [
"default",
"tablet"
"tablet",
"2in1"
],
"deliveryWithInstall": true,
"installationFree": false,

View File

@ -125,12 +125,12 @@ export default function DmsFwkStageTest() {
afterEach(async (done: Function) => {
console.info('DmsFwkStageTest after each called');
let connectIdList: number[] = [connectId,connectId2,extensionConnectId,extensionConnectId2]
await sleep(1000)
for (let i in connectIdList) {
await sleep(1000)
await DisconnectServiceExtensionAbility(connectIdList[i])
console.log('connectIdList i is' + i + connectIdList[i])
}
await sleep(2000)
done();
});
@ -1538,8 +1538,8 @@ export default function DmsFwkStageTest() {
console.info('SUB_DMS_StandardOs_collaboration_connectAbility_StopConnectServiceExtensionAbility_1400 catch error is' + error.code);
expect(true).assertTrue()
}
done();
await sleep(1000);
done();
console.info("---------------SUB_DMS_StandardOs_collaboration_connectAbility_StopConnectServiceExtensionAbility_1400 is end---------------" + connectId)
});
@ -2604,5 +2604,32 @@ export default function DmsFwkStageTest() {
done()
console.info("-----------------SUB_DMS_StandardOs_Collaboration_Bycall_singletonOncall_1500 end------------------------");
})
/*
* @tc.number SUB_DMS_StandardOs_Collaboration_Bycall_singletonOncall_1600
* @tc.name Get call various applications
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_DMS_StandardOs_Collaboration_Bycall_singletonOncall_1600', 0, async (done: Function) => {
console.info("-----------------SUB_DMS_StandardOs_Collaboration_Bycall_singletonOncall_1600 start------------------------");
let context: common.UIAbilityContext | undefined = AppStorage.get('context') as common.UIAbilityContext
context.startAbilityByCall({
bundleName: 'com.acts.example.dmsfwkstageserver',
abilityName: 'MainAbility',
deviceId: dvId
})
.then((data: Caller) => {
call = data;
console.log('get caller is success caller is ' + call)
expect().assertFail()
}).catch((err: BusinessError) => {
console.log('get caller is failed err is ' + JSON.stringify(err))
expect(err.code == 16000050).assertTrue()
})
done()
await sleep(2000)
console.info("-----------------SUB_DMS_StandardOs_Collaboration_Bycall_singletonOncall_1600 end------------------------");
});
})
}

View File

@ -7,7 +7,8 @@
"mainElement": "MainAbility",
"deviceTypes": [
"default",
"tablet"
"tablet",
"2in1"
],
"deliveryWithInstall": true,
"installationFree": false,

View File

@ -7,7 +7,8 @@
"mainElement": "MainAbility",
"deviceTypes": [
"default",
"tablet"
"tablet",
"2in1"
],
"deliveryWithInstall": true,
"installationFree": false,