diff --git a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/CallManageAll.test.js b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/CallManageAll.test.js index 485f8dab95f559f9806c596c11465ab2c45fc3ea..53bec43e9e4f478f3d24e6a32732878ed88810bf 100644 --- a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/CallManageAll.test.js +++ b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/CallManageAll.test.js @@ -185,120 +185,6 @@ describe('CallManageImsCall', function () { callDetailsChangeOff(); console.log('Telephony_CallManager all 54 case is over for callmanager CallManageImsCall'); }); - - /** - * @tc.number Telephony_CallManager_IMS_enableLteEnhanceMode_Async_0400 - * @tc.name Run the function enableLteEnhanceMode by args slotId SLOT_ID_INVALID, - * by callback,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_enableLteEnhanceMode_Async_0400', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_enableLteEnhanceMode_Async_0400'; - call.enableLteEnhanceMode(SLOT_ID_INVALID, (error, data) => { - if (error) { - console.log(`${caseName} enableLteEnhanceMode error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} enableLteEnhanceMode success,case failed,data:${toString(data)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_enableLteEnhanceMode_Promise_0400 - * @tc.name Run the function enableLteEnhanceMode by args slotId SLOT_ID_INVALID by promise, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_enableLteEnhanceMode_Promise_0400', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_enableLteEnhanceMode_Promise_0400'; - call.enableLteEnhanceMode(SLOT_ID_INVALID).then(data => { - expect().assertFail(); - console.log(`${caseName} enableLteEnhanceMode success,case failed,data:${toString(data)}`); - done(); - }).catch(error => { - console.log(`${caseName} enableLteEnhanceMode error,case success,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_disableLteEnhanceMode_Async_0400 - * @tc.name Run the function disableLteEnhanceMode by args slotId SLOT_ID_INVALID, - * by callback,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_disableLteEnhanceMode_Async_0400', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_disableLteEnhanceMode_Async_0400'; - call.disableLteEnhanceMode(SLOT_ID_INVALID, (error, data) => { - if (error) { - console.log(`${caseName} disableLteEnhanceMode error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} disableLteEnhanceMode success,case failed,data:${toString(data)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_disableLteEnhanceMode_Promise_0400 - * @tc.name Run the function disableLteEnhanceMode by args slotId SLOT_ID_INVALID by promise, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_disableLteEnhanceMode_Promise_0400', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_disableLteEnhanceMode_Promise_0400'; - call.disableLteEnhanceMode(SLOT_ID_INVALID).then(data => { - expect().assertFail(); - console.log(`${caseName} disableLteEnhanceMode success,case failed,data:${toString(data)}`); - done(); - }).catch(error => { - console.log(`${caseName} disableLteEnhanceMode error,case success,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_isLteEnhanceModeEnabled_Async_0400 - * @tc.name Run the function isLteEnhanceModeEnabled by args slotId SLOT_ID_INVALID by callback, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_isLteEnhanceModeEnabled_Async_0400', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_isLteEnhanceModeEnabled_Async_0400'; - call.isLteEnhanceModeEnabled(SLOT_ID_INVALID, (error, data) => { - if (error) { - console.log(`${caseName} isLteEnhanceModeEnabled error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} isLteEnhanceModeEnabled success,case failed,data:${toString(data)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_isLteEnhanceModeEnabled_Promise_0400 - * @tc.name Run the function isLteEnhanceModeEnabled by args slotId SLOT_ID_INVALID by promise, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_isLteEnhanceModeEnabled_Promise_0400', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_isLteEnhanceModeEnabled_Promise_0400'; - call.isLteEnhanceModeEnabled(SLOT_ID_INVALID).then(data => { - expect().assertFail(); - console.log(`${caseName} isLteEnhanceModeEnabled success,case failed,data:${toString(data)}`); - done(); - }).catch(error => { - console.log(`${caseName} isLteEnhanceModeEnabled error,case success,error:${toString(error)}`); - done(); - }); - }); /** * @tc.number Telephony_CallManager_IMS_startRTT_Async_0200 diff --git a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/List.test.js b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/List.test.js index 549a4b4de1438406e775166cc0a79cea2c63d728..aff42319687dd8e211891e74de7a598d0139fd12 100644 --- a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/List.test.js +++ b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/List.test.js @@ -13,7 +13,9 @@ * limitations under the License. */ import CallManageImsCall from './CallManageAll.test.js' +import ObjectInterfaceTest from './ObjectInterface_test.js' export default function testsuite() { CallManageImsCall() + ObjectInterfaceTest() } diff --git a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/ObjectInterface_test.js b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/ObjectInterface_test.js new file mode 100644 index 0000000000000000000000000000000000000000..938bbd11e95f0f45768aab61f042d861c565cbdc --- /dev/null +++ b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/ObjectInterface_test.js @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import contactsapi from "@ohos.contact"; +import {afterAll, afterEach, beforeAll, beforeEach, describe, expect, it} from '@ohos/hypium' + +export default function ObjectInterfaceTest() { + describe('ObjectInterfaceTest', function () { + function sleep(numberMillis) { + var now = new Date(); + var exitTime = now.getTime() + numberMillis; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) + return; + } + } + var contactData = { + id: 0, + key: "0", + contactAttributes: { + attributes: [contactsapi.Attribute.ATTR_CONTACT_EVENT, contactsapi.Attribute.ATTR_EMAIL, + contactsapi.Attribute.ATTR_GROUP_MEMBERSHIP, + contactsapi.Attribute.ATTR_IM, contactsapi.Attribute.ATTR_NAME, contactsapi.Attribute.ATTR_NICKNAME, + contactsapi.Attribute.ATTR_NOTE, contactsapi.Attribute.ATTR_ORGANIZATION, contactsapi.Attribute.ATTR_PHONE, + contactsapi.Attribute.ATTR_PORTRAIT, contactsapi.Attribute.ATTR_POSTAL_ADDRESS, + contactsapi.Attribute.ATTR_RELATION, + contactsapi.Attribute.ATTR_SIP_ADDRESS, contactsapi.Attribute.ATTR_WEBSITE] + }, + emails: [{ + email: "email", labelName: "自定义邮箱", labelId: 1, displayName: "emailDisplayName" + }], + events: [{ + eventDate: "event", labelName: "自定义event", labelId: 2 + }], + groups: [{ + groupId: 1, title: "群组" + }], + imAddresses: [{ + imAddress: "imAddress", labelName: "自定义", labelId: 3 + }], + phoneNumbers: [{ + phoneNumber: "183", labelName: "自定义phoneNumbers", labelId: 4 + }], + portrait: { + uri: "content://head/0" + }, + postalAddresses: [{ + city: "南京", + country: "中国", + labelName: "labelName", + neighborhood: "neighborhood", + pobox: "pobox", + postalAddress: "postalAddress", + postcode: "postcode", + region: "region", + street: "street", + labelId: 5 + }], + relations: [{ + relationName: "relationName", labelName: "自定义relationName", labelId: 6 + }], + sipAddresses: [{ + sipAddress: "sipAddress", labelName: "自定义sipAddress", labelId: 6 + }], + websites: [{ + website: "website" + }], + name: { + familyName: "familyName", + familyNamePhonetic: "familyNamePhonetic", + fullName: "小李", + givenName: "givenName", + givenNamePhonetic: "givenNamePhonetic", + middleName: "middleName", + middleNamePhonetic: "middleNamePhonetic", + namePrefix: "namePrefix", + nameSuffix: "nameSuffix" + }, + nickName: { + nickName: "nickName" + }, + note: { + noteContent: "note" + }, + organization: { + name: "TT", title: "开发" + } + }; + + var gRawContactId; + var gGroup; + + + it("contactsApi_contactdata_test_100", 0, async function (done) { + console.info("contactData.id" + contactData.id); + console.info("contactData.id" + (contactData.id == 0)); + expect(contactData.id == 0).assertTrue(); + console.info("contactData.key" + contactData.key); + console.info("contactData.key" + (contactData.key=="0")); + expect(contactData.key).assertEqual("0"); + console.info("contactData.contactAttributes" + contactData.contactAttributes); + console.info("contactData.contactAttributes" + (contactData.contactAttributes != null)); + expect(contactData.contactAttributes != null).assertTrue(); + console.info("contactData.emails" + contactData.emails); + expect(contactData.emails != null).assertTrue(); + expect(contactData.events != null).assertTrue(); + expect(contactData.groups != null).assertTrue(); + expect(contactData.imAddresses != null).assertTrue(); + done(); + }); + + it("contactsApi_contactdata_test_200", 0, async function (done) { + expect(contactData.phoneNumbers != null).assertTrue(); + expect(contactData.portrait != null).assertTrue(); + expect(contactData.postalAddresses != null).assertTrue(); + expect(contactData.relations != null).assertTrue(); + expect(contactData.sipAddresses != null).assertTrue(); + expect(contactData.websites != null).assertTrue(); + expect(contactData.name != null).assertTrue(); + expect(contactData.nickName != null).assertTrue(); + expect(contactData.note != null).assertTrue(); + expect(contactData.organization != null).assertTrue(); + expect(contactData.contactAttributes.attributes != null).assertTrue(); + done(); + }); + + it("contactsApi_contactdata_test_300", 0, async function (done) { + expect(contactData.emails.email === null).assertFalse(); + expect(contactData.emails.labelName === null).assertFalse(); + console.info("contactData.emails.labelId == 1" + contactData.emails.labelId); + expect(contactData.emails.labelId != 0).assertTrue(); + expect(contactData.emails.displayName === null).assertFalse(); + expect(contactData.events.eventDate === null).assertFalse(); + expect(contactData.events.labelName === null).assertFalse(); + expect(contactData.events.labelId != 0).assertTrue(); + expect(contactData.groups.groupId != 0).assertTrue(); + expect(contactData.groups.title === null).assertFalse(); + done(); + }); + it("contactsApi_contactdata_test_400", 0, async function (done) { + expect(contactData.imAddresses.imAddress === null).assertFalse(); + expect(contactData.imAddresses.labelName === null).assertFalse(); + expect(contactData.imAddresses.labelId != 0).assertTrue(); + expect(contactData.name.familyName === null).assertFalse(); + expect(contactData.name.familyNamePhonetic === null).assertFalse(); + expect(contactData.name.fullName === null).assertFalse(); + expect(contactData.name.givenName === null).assertFalse(); + expect(contactData.name.givenNamePhonetic === null).assertFalse(); + expect(contactData.name.middleName === null).assertFalse(); + expect(contactData.name.middleNamePhonetic === null).assertFalse(); + expect(contactData.name.namePrefix === null).assertFalse(); + expect(contactData.name.nameSuffix === null).assertFalse(); + done(); + }); + + it("contactsApi_contactdata_test_500", 0, async function (done) { + expect(contactData.nickName.nickName === null).assertFalse(); + expect(contactData.note.noteContent === null).assertFalse(); + expect(contactData.organization.name === null).assertFalse(); + expect(contactData.organization.title === null).assertFalse(); + expect(contactData.phoneNumbers.labelId != 0).assertTrue(); + expect(contactData.phoneNumbers.labelName === null).assertFalse(); + expect(contactData.phoneNumbers.phoneNumber === null).assertFalse(); + expect(contactData.portrait.uri === null).assertFalse(); + done(); + }); + + it("contactsApi_contactdata_test_600", 0, async function (done) { + console.info("contactData.postalAddresses.city != null" + + contactData.postalAddresses.city + +(contactData.postalAddresses.city != null)); + expect(contactData.postalAddresses.city === null).assertFalse(); + expect(contactData.postalAddresses.country === null).assertFalse(); + expect(contactData.postalAddresses.labelName === null).assertFalse(); + expect(contactData.postalAddresses.neighborhood === null).assertFalse(); + expect(contactData.postalAddresses.pobox === null).assertFalse(); + expect(contactData.postalAddresses.postalAddress === null).assertFalse(); + expect(contactData.postalAddresses.postcode === null).assertFalse(); + expect(contactData.postalAddresses.region === null).assertFalse(); + expect(contactData.postalAddresses.street === null).assertFalse(); + expect(contactData.postalAddresses.labelId != 0).assertTrue(); + done(); + }); + + it("contactsApi_contactdata_test_700", 0, async function (done) { + console.info("contactData.relations.labelName != null" + + contactData.relations.labelName +(contactData.relations.labelName === null)); + expect(contactData.relations.labelId != 0).assertTrue(); + expect(contactData.relations.labelName === null).assertFalse(); + expect(contactData.relations.relationName === null).assertFalse(); + expect(contactData.sipAddresses.labelId != 0).assertTrue(); + expect(contactData.sipAddresses.labelName === null).assertFalse(); + expect(contactData.sipAddresses.sipAddress === null).assertFalse(); + expect(contactData.websites.website === null).assertFalse(); + done(); + }); + + + it("contactsApi_contactdata_test_800", 0, async function (done) { + expect(contactsapi.Contact.INVALID_CONTACT_ID == -1).assertTrue(); + expect(contactsapi.Attribute.ATTR_CONTACT_EVENT == + contactData.contactAttributes.attributes[0]).assertTrue(); + expect(contactsapi.Attribute.ATTR_EMAIL == contactData.contactAttributes.attributes[1]).assertTrue(); + expect(contactsapi.Attribute.ATTR_GROUP_MEMBERSHIP == + contactData.contactAttributes.attributes[2]).assertTrue(); + expect(contactsapi.Attribute.ATTR_IM == contactData.contactAttributes.attributes[3]).assertTrue(); + expect(contactsapi.Attribute.ATTR_NAME == contactData.contactAttributes.attributes[4]).assertTrue(); + expect(contactsapi.Attribute.ATTR_NICKNAME == contactData.contactAttributes.attributes[5]).assertTrue(); + expect(contactsapi.Attribute.ATTR_NOTE == contactData.contactAttributes.attributes[6]).assertTrue(); + expect(contactsapi.Attribute.ATTR_ORGANIZATION == contactData.contactAttributes.attributes[7]).assertTrue(); + expect(contactsapi.Attribute.ATTR_PHONE == contactData.contactAttributes.attributes[8]).assertTrue(); + expect(contactsapi.Attribute.ATTR_PORTRAIT == contactData.contactAttributes.attributes[9]).assertTrue(); + expect(contactsapi.Attribute.ATTR_POSTAL_ADDRESS == + contactData.contactAttributes.attributes[10]).assertTrue(); + expect(contactsapi.Attribute.ATTR_RELATION == contactData.contactAttributes.attributes[11]).assertTrue(); + expect(contactsapi.Attribute.ATTR_SIP_ADDRESS == contactData.contactAttributes.attributes[12]).assertTrue(); + expect(contactsapi.Attribute.ATTR_WEBSITE == contactData.contactAttributes.attributes[13]).assertTrue(); + done(); + }); + + it("contactsApi_contactdata_test_900", 0, async function (done) { + expect(contactsapi.Email.CUSTOM_LABEL == 0).assertTrue(); + expect(contactsapi.Email.EMAIL_HOME == 1).assertTrue(); + expect(contactsapi.Email.EMAIL_WORK == 2).assertTrue(); + expect(contactsapi.Email.EMAIL_OTHER == 3).assertTrue(); + expect(contactsapi.Email.INVALID_LABEL_ID == -1).assertTrue(); + expect(contactsapi.Event.CUSTOM_LABEL == 0).assertTrue(); + expect(contactsapi.Event.EVENT_ANNIVERSARY == 1).assertTrue(); + expect(contactsapi.Event.EVENT_OTHER == 2).assertTrue(); + expect(contactsapi.Event.EVENT_BIRTHDAY == 3).assertTrue(); + expect(contactsapi.Email.INVALID_LABEL_ID == -1).assertTrue(); + expect(contactsapi.ImAddress.CUSTOM_LABEL == -1).assertTrue(); + expect(contactsapi.ImAddress.IM_AIM == 0).assertTrue(); + expect(contactsapi.ImAddress.IM_MSN == 1).assertTrue(); + expect(contactsapi.ImAddress.IM_YAHOO == 2).assertTrue(); + expect(contactsapi.ImAddress.IM_SKYPE == 3).assertTrue(); + expect(contactsapi.ImAddress.IM_QQ == 4).assertTrue(); + expect(contactsapi.ImAddress.IM_ICQ == 6).assertTrue(); + expect(contactsapi.ImAddress.IM_JABBER == 7).assertTrue(); + expect(contactsapi.ImAddress.INVALID_LABEL_ID == -2).assertTrue(); + done(); + }); + + it("contactsApi_contactdata_test_1000", 0, async function (done) { + expect(contactsapi.PhoneNumber.CUSTOM_LABEL == 0).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_HOME == 1).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_MOBILE == 2).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_WORK == 3).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_FAX_WORK == 4).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_FAX_HOME == 5).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_PAGER == 6).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_OTHER == 7).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_CALLBACK == 8).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_CAR == 9).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_COMPANY_MAIN == 10).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_ISDN == 11).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_MAIN == 12).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_OTHER_FAX == 13).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_RADIO == 14).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_TELEX == 15).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_TTY_TDD == 16).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_WORK_MOBILE == 17).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_WORK_PAGER == 18).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_ASSISTANT == 19).assertTrue(); + expect(contactsapi.PhoneNumber.NUM_MMS == 20).assertTrue(); + expect(contactsapi.PhoneNumber.INVALID_LABEL_ID == -1).assertTrue(); + expect(contactsapi.PostalAddress.CUSTOM_LABEL == 0).assertTrue(); + expect(contactsapi.PostalAddress.ADDR_HOME == 1).assertTrue(); + expect(contactsapi.PostalAddress.ADDR_WORK == 2).assertTrue(); + expect(contactsapi.PostalAddress.ADDR_OTHER == 3).assertTrue(); + expect(contactsapi.PostalAddress.INVALID_LABEL_ID == -1).assertTrue(); + done(); + }); + + it("contactsApi_contactdata_test_1100", 0, async function (done) { + expect(contactsapi.Relation.CUSTOM_LABEL == 0).assertTrue(); + expect(contactsapi.Relation.RELATION_ASSISTANT == 1).assertTrue(); + expect(contactsapi.Relation.RELATION_BROTHER == 2).assertTrue(); + expect(contactsapi.Relation.RELATION_CHILD == 3).assertTrue(); + expect(contactsapi.Relation.RELATION_DOMESTIC_PARTNER == 4).assertTrue(); + expect(contactsapi.Relation.RELATION_FATHER == 5).assertTrue(); + expect(contactsapi.Relation.RELATION_FRIEND == 6).assertTrue(); + expect(contactsapi.Relation.RELATION_MANAGER == 7).assertTrue(); + expect(contactsapi.Relation.RELATION_MOTHER == 8).assertTrue(); + expect(contactsapi.Relation.RELATION_PARENT == 9).assertTrue(); + expect(contactsapi.Relation.RELATION_PARTNER == 10).assertTrue(); + expect(contactsapi.Relation.RELATION_REFERRED_BY == 11).assertTrue(); + expect(contactsapi.Relation.RELATION_RELATIVE == 12).assertTrue(); + expect(contactsapi.Relation.RELATION_SISTER == 13).assertTrue(); + expect(contactsapi.Relation.RELATION_SPOUSE == 14).assertTrue(); + expect(contactsapi.Relation.INVALID_LABEL_ID == -1).assertTrue(); + expect(contactsapi.SipAddress.CUSTOM_LABEL == 0).assertTrue(); + expect(contactsapi.SipAddress.SIP_HOME == 1).assertTrue(); + expect(contactsapi.SipAddress.SIP_WORK == 2).assertTrue(); + expect(contactsapi.SipAddress.SIP_OTHER == 3).assertTrue(); + expect(contactsapi.SipAddress.INVALID_LABEL_ID == -1).assertTrue(); + done(); + }); + + }); +} \ No newline at end of file diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/CallJsunit.test.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/CallJsunit.test.ets index 6b2cf72ca59b24cf6be7884f951b1e949d79c9ed..bee6828d076b7a12369de0562e795a500031e1fe 100644 --- a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/CallJsunit.test.ets +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/CallJsunit.test.ets @@ -45,65 +45,7 @@ export default function callJsunit(){ console.log("==========> call Test start ==========>"); - /** - * @tc.number Telephony_Call_Call_MakeCall_0100 - * @tc.name Make a call. - * @tc.desc Function test - */ - it("Telephony_Call_Call_MakeCall_0100",0,async function(done){ - let caseName:string = "Telephony_Call_Call_MakeCall_0100"; - console.log(`==========> ${caseName} Test start ==========>`); - try{ - let telNumber = ""; - call.makeCall(telNumber,(error) => { - if(error){ - console.log(`${caseName} fail,case success,error:${toString(error)}`); - expect(true).assertTrue(); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} success,case fail`); - done(); - }); - }catch(err){ - console.log(`${caseName} fail,case success,error:${toString(err)}`); - expect(true).assertTrue(); - done(); - return; - } - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); - /** - * @tc.number Telephony_Call_Call_MakeCall_0200 - * @tc.name Makes a call. - * @tc.desc Function test - */ - it("Telephony_Call_Call_MakeCall_0200",0,async function(done){ - let caseName:string = "Telephony_Call_Call_MakeCall_0200"; - console.log(`==========> ${caseName} Test start ==========>`); - let telNumber = ""; - try{ - call.makeCall(telNumber).then(()=>{ - console.log(`${caseName} success,case fail`); - done(); - }).catch(error =>{ - console.log(`${caseName} fail,case success,error:${toString(error)}`); - expect(true).assertTrue(); - done(); - return; - }); - }catch(err){ - console.log(`${caseName} fail,case success,error:${toString(err)}`); - expect(true).assertTrue(); - done(); - return; - } - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); /** * @tc.number Telephony_Call_HasVoiceCapability_HasVoiceCapability @@ -497,6 +439,66 @@ export default function callJsunit(){ done(); }); + /** + * @tc.number Telephony_Call_Call_MakeCall_0100 + * @tc.name Make a call. + * @tc.desc Function test + */ + it("Telephony_Call_Call_MakeCall_0100",0,async function(done){ + let caseName:string = "Telephony_Call_Call_MakeCall_0100"; + console.log(`==========> ${caseName} Test start ==========>`); + try{ + let telNumber = ""; + call.makeCall(telNumber,(error) => { + if(error){ + console.log(`${caseName} fail,case success,error:${toString(error)}`); + expect(true).assertTrue(); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} success,case fail`); + done(); + }); + }catch(err){ + console.log(`${caseName} fail,case success,error:${toString(err)}`); + expect(true).assertTrue(); + done(); + return; + } + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_Call_MakeCall_0200 + * @tc.name Makes a call. + * @tc.desc Function test + */ + it("Telephony_Call_Call_MakeCall_0200",0,async function(done){ + let caseName:string = "Telephony_Call_Call_MakeCall_0200"; + console.log(`==========> ${caseName} Test start ==========>`); + let telNumber = ""; + try{ + call.makeCall(telNumber).then(()=>{ + console.log(`${caseName} success,case fail`); + done(); + }).catch(error =>{ + console.log(`${caseName} fail,case success,error:${toString(error)}`); + expect(true).assertTrue(); + done(); + return; + }); + }catch(err){ + console.log(`${caseName} fail,case success,error:${toString(err)}`); + expect(true).assertTrue(); + done(); + return; + } + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + }); } diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/List.test.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/List.test.ets index 93fe7b42cac91935af3ee34e299932965367d8f9..77cb733449ee6b978cd72086784b6def46d93484 100644 --- a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/List.test.ets +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/List.test.ets @@ -24,9 +24,9 @@ import dataJsunit from './DataJsunit.test.ets'; export default function testsuite() { //other dataJsunit(); - callJsunit(); smsUiJsunit(); convertOptionsJsunit(); radioJsunit(); radioSecondJsunit(); + callJsunit(); } \ No newline at end of file