diff --git a/telephony/telephonyjstest/actscontactstageapitest/entry/src/main/ets/test/contactstage.test.ets b/telephony/telephonyjstest/actscontactstageapitest/entry/src/main/ets/test/contactstage.test.ets index 2ffef4484f6ad7df0ae7a6ad599ca349217afc47..68e7a291ecd13acc6261f2982913aac27f9fbd97 100644 --- a/telephony/telephonyjstest/actscontactstageapitest/entry/src/main/ets/test/contactstage.test.ets +++ b/telephony/telephonyjstest/actscontactstageapitest/entry/src/main/ets/test/contactstage.test.ets @@ -1634,5 +1634,111 @@ export default function ContactInterfaceStageTest() { }); sleep(500); }); + + /** + * @tc.number SUB_Telephony_ContactsApi_selectContacts_test_0100 + * @tc.name contactsApi_selectContacts error + * @tc.desc Function test + */ + it("SUB_Telephony_ContactsApi_selectContacts_test_0100", 0, async function (done) { + contact.addContact(globalThis.context, contactData, (err, data) => { + if (!err) { + console.info("SUB_Telephony_ContactsApi_selectContacts_test_0100 data = " + JSON.stringify(data)); + expect(data > 0).assertTrue(); + done(); + return; + } + contact.selectContacts((err, data) => { + if (err) { + console.info("SUB_Telephony_ContactsApi_selectContacts_test_0100 err = " + JSON.stringify(err)); + expect(false).assertTrue(); + done(); + return; + } + console.info("SUB_Telephony_ContactsApi_selectContacts_test_0100 data = " + JSON.stringify(data)); + done(); + }); + }); + sleep(500); + }); + + /** + * @tc.number SUB_Telephony_ContactsApi_selectContacts_test_0200 + * @tc.name contactsApi_selectContacts error + * @tc.desc Function test + */ + it("SUB_Telephony_ContactsApi_selectContacts_test_0200", 0, async function (done) { + contact.addContact(globalThis.context, contactData, (err, data) => { + if (!err) { + console.info("SUB_Telephony_ContactsApi_selectContacts_test_0200 data = " + JSON.stringify(data)); + expect(data > 0).assertTrue(); + done(); + return; + } + contact.selectContacts().then((data) => { + console.info("SUB_Telephony_ContactsApi_selectContacts_test_0200 data = " + JSON.stringify(data)); + done(); + }).catch((err) => { + console.info("SUB_Telephony_ContactsApi_selectContacts_test_0200 err = " + JSON.stringify(err)); + expect(false).assertTrue(); + done(); + return; + }); + }); + sleep(500); + }); + + /** + * @tc.number SUB_Telephony_ContactsApi_selectContacts_test_0300 + * @tc.name contactsApi_selectContacts error + * @tc.desc Function test + */ + it("SUB_Telephony_ContactsApi_selectContacts_test_0300", 0, async function (done) { + contact.addContact(globalThis.context, contactData, (err, data) => { + if (!err) { + console.info("SUB_Telephony_ContactsApi_selectContacts_test_0300 data = " + JSON.stringify(data)); + expect(data > 0).assertTrue(); + done(); + return; + } + contact.selectContacts({isMultiSelect : false}, (err, data) => { + if (err) { + console.info("SUB_Telephony_ContactsApi_selectContacts_test_0300 err = " + JSON.stringify(err)); + expect(false).assertTrue(); + done(); + return; + } + console.info("SUB_Telephony_ContactsApi_selectContacts_test_0300 data = " + JSON.stringify(data)); + done(); + }); + }); + sleep(500); + }); + + /** + * @tc.number SUB_Telephony_ContactsApi_selectContacts_test_0400 + * @tc.name contactsApi_selectContacts error + * @tc.desc Function test + */ + it("SUB_Telephony_ContactsApi_selectContacts_test_0400", 0, async function (done) { + contact.addContact(globalThis.context, contactData, (err, data) => { + if (!err) { + console.info("SUB_Telephony_ContactsApi_selectContacts_test_0400 data = " + JSON.stringify(data)); + expect(data > 0).assertTrue(); + done(); + return; + } + contact.selectContacts({isMultiSelect : false}).then((data) => { + console.info("SUB_Telephony_ContactsApi_selectContacts_test_0400 data = " + JSON.stringify(data)); + done(); + }).catch((err) => { + console.info("SUB_Telephony_ContactsApi_selectContacts_test_0400 err = " + JSON.stringify(err)); + expect(false).assertTrue(); + done(); + return; + }); + }); + sleep(500); + }); }); } \ No newline at end of file diff --git a/telephony/telephonyjstest/netmanager_base/register/src/main/js/test/NetworkManagerRegister.test.js b/telephony/telephonyjstest/netmanager_base/register/src/main/js/test/NetworkManagerRegister.test.js index 3a65b7127c8a7440b66c6d4040c652524c10683c..5a714fb77e0e4bab59ed290ac15dbefbdda467f1 100644 --- a/telephony/telephonyjstest/netmanager_base/register/src/main/js/test/NetworkManagerRegister.test.js +++ b/telephony/telephonyjstest/netmanager_base/register/src/main/js/test/NetworkManagerRegister.test.js @@ -44,6 +44,7 @@ export default function Telephony_NetworkManagerRegisterTest() { }); netConn.on('netCapabilitiesChange', function (value) { console.log("netCapabilitiesChange " + JSON.stringify(value)); + expect(value.NetHandle !== undefined).assertTrue(); }); netConn.on('netConnectionPropertiesChange', function (value) { console.log("netConnectionPropertiesChange" + JSON.stringify(value));