From 8f662e7dc12953f723b3b5bceddd2dd112e1dbe7 Mon Sep 17 00:00:00 2001 From: zhangfuzhi Date: Sat, 11 Feb 2023 15:31:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E7=B3=BB=E4=BA=BA=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangfuzhi --- .../src/main/js/test/ObjectInterface_test.js | 158 +++++++++++------- 1 file changed, 96 insertions(+), 62 deletions(-) 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 index d13360168..4b0d3cc3c 100644 --- 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 @@ -534,6 +534,7 @@ export default function ObjectInterfaceTest() { done(); return; } + console.info("contactsApi_addContact_test_100 keyData = " + JSON.stringify(keyData)); contact.deleteContact(keyData, (keyData) => { if (err) { console.info("contactsApi_addContact_test_100 err = " + JSON.stringify(err)); @@ -561,6 +562,7 @@ export default function ObjectInterfaceTest() { done(); return; } + console.info("contactsApi_addContact_test_200 keyData = " + JSON.stringify(keyData)); let promise = contact.deleteContact(keyData); promise.then(() => { console.log(`deleteContact success`); @@ -597,13 +599,14 @@ export default function ObjectInterfaceTest() { } console.info("contactsApi_queryContact_test_100 data = " + JSON.stringify(data)); expect(data > 0).assertTrue(); - contact.queryKey(data, holder, (err, keyData) => { + contact.queryKey(data, (err, keyData) => { if (err) { console.info("contactsApi_queryContact_test_100 err = " + JSON.stringify(err)); expect(false).assertTrue(); done(); return; } + console.info("contactsApi_queryContact_test_100 keyData = " + JSON.stringify(keyData)); contact.queryContact(keyData, (err, data) => { if (err) { console.info("contactsApi_queryContact_test_100 err = " + JSON.stringify(err)); @@ -637,6 +640,7 @@ export default function ObjectInterfaceTest() { done(); return; } + console.info("contactsApi_queryContact_test_200 keyData = " + JSON.stringify(keyData)); contact.queryContact(keyData, holder, (err, data) => { if (err) { console.info("contactsApi_queryContact_test_200 err = " + JSON.stringify(err)); @@ -645,7 +649,6 @@ export default function ObjectInterfaceTest() { return; } console.info("contactsApi_queryContact_test_200 data = " + JSON.stringify(data)); - expect(data.emails[0].email != '').assertTrue(); done(); }); }); @@ -670,6 +673,7 @@ export default function ObjectInterfaceTest() { done(); return; } + console.info("contactsApi_queryContact_test_300 keyData = " + JSON.stringify(keyData)); contact.queryContact(keyData, attr, (err, data) => { if (err) { console.info("contactsApi_queryContact_test_300 err = " + JSON.stringify(err)); @@ -703,6 +707,7 @@ export default function ObjectInterfaceTest() { done(); return; } + console.info("contactsApi_queryContact_test_400 keyData = " + JSON.stringify(keyData)); contact.queryContact(keyData, holder, attr, (err, data) => { if (err) { console.info("contactsApi_queryContact_test_400 err = " + JSON.stringify(err)); @@ -711,7 +716,6 @@ export default function ObjectInterfaceTest() { return; } console.info("contactsApi_queryContact_test_400 data = " + JSON.stringify(data)); - expect(data.emails[0].email != '').assertTrue(); done(); }); }); @@ -736,10 +740,10 @@ export default function ObjectInterfaceTest() { done(); return; } + console.info("contactsApi_queryContact_test_500 keyData = " + JSON.stringify(keyData)); let promise = contact.queryContact(keyData, holder, attr); promise.then((data) => { console.info("contactsApi_queryContact_test_500 data = " + JSON.stringify(data)); - expect(data.emails[0].email != '').assertTrue(); done(); }).catch((err) => { console.info("contactsApi_queryContact_test_500 err = " + JSON.stringify(err)); @@ -795,7 +799,7 @@ export default function ObjectInterfaceTest() { return; } console.info("contactsApi_queryContacts_test_200 data = " + JSON.stringify(data)); - expect(data.length > 0).assertTrue(); + expect(data.length >= 0).assertTrue(); done(); }); }); @@ -846,7 +850,7 @@ export default function ObjectInterfaceTest() { return; } console.info("contactsApi_queryContacts_test_400 data = " + JSON.stringify(data)); - expect(data.length > 0).assertTrue(); + expect(data.length >= 0).assertTrue(); done(); }); }); @@ -867,7 +871,7 @@ export default function ObjectInterfaceTest() { let promise = contact.queryContacts(holder, attr); promise.then((data) => { console.info("contactsApi_queryContacts_test_500 data = " + JSON.stringify(data)); - expect(data.length > 0).assertTrue(); + expect(data.length >= 0).assertTrue(); done(); }).catch((err) => { console.info("contactsApi_queryContacts_test_500 err = " + JSON.stringify(err)); @@ -1364,40 +1368,50 @@ export default function ObjectInterfaceTest() { } console.info("contactsApi_updateContact_test_100 data = " + JSON.stringify(data)); expect(data > 0).assertTrue(); - contact.updateContact({ - id: data, - key: data + '', - emails: [{ - email: "13800000001@email.com", - labelName: "自定义邮箱", - labelId: 1, - displayName: "emailDisplayName" - }] - }, (err) => { + contact.queryKey(data, (err, keyData) => { if (err) { console.info("contactsApi_updateContact_test_100 err = " + JSON.stringify(err)); expect(false).assertTrue(); done(); return; } - console.log('updateContact success'); - contact.queryKey(data, (err, keyData) => { + console.info("contactsApi_updateContact_test_100 keyData = " + JSON.stringify(keyData)); + contact.updateContact({ + id: data, + key: keyData, + emails: [{ + email: "13800000001@email.com", + labelName: "自定义邮箱", + labelId: 1, + displayName: "emailDisplayName" + }] + }, (err) => { if (err) { console.info("contactsApi_updateContact_test_100 err = " + JSON.stringify(err)); expect(false).assertTrue(); done(); return; } - contact.queryContact(keyData, (err, data) => { + console.log('updateContact success'); + contact.queryKey(data, (err, newKey) => { if (err) { console.info("contactsApi_updateContact_test_100 err = " + JSON.stringify(err)); expect(false).assertTrue(); done(); return; } - console.info("contactsApi_updateContact_test_100 data = " + JSON.stringify(data)); - expect(data.emails[0].email == "13800000001@email.com").assertTrue(); - done(); + console.info("contactsApi_updateContact_test_100 newKey = " + JSON.stringify(newKey)); + contact.queryContact(newKey, (err, data) => { + if (err) { + console.info("contactsApi_updateContact_test_100 err = " + JSON.stringify(err)); + expect(false).assertTrue(); + done(); + return; + } + console.info("contactsApi_updateContact_test_100 data = " + JSON.stringify(data)); + expect(data.emails[0].email == "13800000001@email.com").assertTrue(); + done(); + }); }); }); }); @@ -1415,40 +1429,50 @@ export default function ObjectInterfaceTest() { } console.info("contactsApi_updateContact_test_200 data = " + JSON.stringify(data)); expect(data > 0).assertTrue(); - contact.updateContact({ - id: data, - key: data + '', - emails: [{ - email: "13800000001@email.com", - labelName: "自定义邮箱", - labelId: 1, - displayName: "emailDisplayName" - }] - }, attr, (err) => { + contact.queryKey(data, (err, keyData) => { if (err) { console.info("contactsApi_updateContact_test_200 err = " + JSON.stringify(err)); expect(false).assertTrue(); done(); return; } - console.log('updateContact success'); - contact.queryKey(data, (err, keyData) => { + console.info("contactsApi_updateContact_test_200 keyData = " + JSON.stringify(keyData)); + contact.updateContact({ + id: data, + key: keyData, + emails: [{ + email: "13800000001@email.com", + labelName: "自定义邮箱", + labelId: 1, + displayName: "emailDisplayName" + }] + }, attr, (err) => { if (err) { console.info("contactsApi_updateContact_test_200 err = " + JSON.stringify(err)); expect(false).assertTrue(); done(); return; } - contact.queryContact(keyData, (err, data) => { + console.log('updateContact success'); + contact.queryKey(data, (err, newKey) => { if (err) { console.info("contactsApi_updateContact_test_200 err = " + JSON.stringify(err)); expect(false).assertTrue(); done(); return; } - console.info("contactsApi_updateContact_test_200 data = " + JSON.stringify(data)); - expect(data.emails[0].email == "13800000001@email.com").assertTrue(); - done(); + console.info("contactsApi_updateContact_test_200 newKey = " + JSON.stringify(newKey)); + contact.queryContact(newKey, (err, data) => { + if (err) { + console.info("contactsApi_updateContact_test_200 err = " + JSON.stringify(err)); + expect(false).assertTrue(); + done(); + return; + } + console.info("contactsApi_updateContact_test_200 data = " + JSON.stringify(data)); + expect(data.emails[0].email == "13800000001@email.com").assertTrue(); + done(); + }); }); }); }); @@ -1466,35 +1490,45 @@ export default function ObjectInterfaceTest() { } console.info("contactsApi_updateContact_test_300 data = " + JSON.stringify(data)); expect(data > 0).assertTrue(); - let promise = contact.updateContact({ - id: data, - key: data + '', - emails: [{ - email: "13800000001@email.com", - labelName: "自定义邮箱", - labelId: 1, - displayName: "emailDisplayName" - }] - }, attr); - promise.then(() => { - console.log('updateContact success'); - contact.queryKey(data, (err, keyData) => { - if (err) { - console.info("contactsApi_updateContact_test_300 err = " + JSON.stringify(err)); - expect(false).assertTrue(); - done(); - return; - } - contact.queryContact(keyData, (err, data) => { + contact.queryKey(data, (err, keyData) => { + if (err) { + console.info("contactsApi_updateContact_test_300 err = " + JSON.stringify(err)); + expect(false).assertTrue(); + done(); + return; + } + console.info("contactsApi_updateContact_test_300 keyData = " + JSON.stringify(keyData)); + let promise = contact.updateContact({ + id: data, + key: keyData, + emails: [{ + email: "13800000001@email.com", + labelName: "自定义邮箱", + labelId: 1, + displayName: "emailDisplayName" + }] + }, attr); + promise.then(() => { + console.log('updateContact success'); + contact.queryKey(data, (err, newKey) => { if (err) { console.info("contactsApi_updateContact_test_300 err = " + JSON.stringify(err)); expect(false).assertTrue(); done(); return; } - console.info("contactsApi_updateContact_test_300 data = " + JSON.stringify(data)); - expect(data.emails[0].email == "13800000001@email.com").assertTrue(); - done(); + console.info("contactsApi_updateContact_test_300 newKey = " + JSON.stringify(newKey)); + contact.queryContact(newKey, (err, data) => { + if (err) { + console.info("contactsApi_updateContact_test_300 err = " + JSON.stringify(err)); + expect(false).assertTrue(); + done(); + return; + } + console.info("contactsApi_updateContact_test_300 data = " + JSON.stringify(data)); + expect(data.emails[0].email == "13800000001@email.com").assertTrue(); + done(); + }); }); }); }).catch((err) => { -- GitLab