From ad6fb8e4057bca81f798ada36b9499eb0431053c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E6=9B=A6?= Date: Fri, 25 Feb 2022 20:39:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B5=E8=AF=9D=E5=AD=90=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=A6=86=E7=9B=96=E7=8E=87=E6=8F=90=E5=8D=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 高曦 --- .../call_manager_ims2_call/Test.json | 5 ++--- .../src/main/js/default/pages/index/index.js | 2 +- .../cellular_data_abnormal/Test.json | 5 ++--- .../src/main/js/default/pages/index/index.js | 2 +- .../network_search_errors/Test.json | 5 ++--- .../src/main/js/default/pages/index/index.js | 2 +- .../main/js/test/NetworkSearchErrors.test.js | 19 ++++++++++++++++--- .../sim/sim_manager_function_test/Test.json | 5 ++--- .../src/main/js/default/pages/index/index.js | 2 +- .../sms_mms/sms_mms_error/Test.json | 5 ++--- .../src/main/js/default/pages/index/index.js | 2 +- .../src/main/js/test/SmsMmsError.test.js | 17 +++++++++++++++++ 12 files changed, 48 insertions(+), 23 deletions(-) diff --git a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/Test.json b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/Test.json index d56e2bcbc..37539e4d7 100644 --- a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/Test.json +++ b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/Test.json @@ -2,10 +2,9 @@ "description": "Configuration for ActsCallManagerIms2CallTest Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "1200000", + "test-timeout": "1800000", "package": "com.ohos.actscallmanagerims2calltest", - "shell-timeout": "1200000", - "native-test-timeout":"1200000" + "shell-timeout": "60000" }, "kits": [ { diff --git a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/entry/src/main/js/default/pages/index/index.js index 4b9bce0e7..30709abba 100644 --- a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/entry/src/main/js/default/pages/index/index.js +++ b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/entry/src/main/js/default/pages/index/index.js @@ -38,7 +38,7 @@ export default { core.addService('expect', expectExtend) core.init() const configService = core.getDefaultService('config') - configService.timeout = 8000; + this.timeout = 30000; configService.setConfig(this) require('../../../test/List.test') core.execute() diff --git a/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/Test.json b/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/Test.json index 411be27c3..d7145f5da 100644 --- a/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/Test.json +++ b/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/Test.json @@ -2,10 +2,9 @@ "description": "Configuration for callmanager Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "18000", + "test-timeout": "1800000", "package": "com.ohos.cellulardata", - "shell-timeout": "18000", - "native-test-timeout":"18000" + "shell-timeout": "60000" }, "kits": [ { diff --git a/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/entry/src/main/js/default/pages/index/index.js index f159d2674..8d813e891 100644 --- a/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/entry/src/main/js/default/pages/index/index.js +++ b/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/entry/src/main/js/default/pages/index/index.js @@ -37,7 +37,7 @@ export default { core.init() const configService = core.getDefaultService('config') - configService.timeout = 8000 + this.timeout = 30000 configService.setConfig(this) require('../../../test/List.test') core.execute() diff --git a/telephony/telephonyjstest/network_search/network_search_errors/Test.json b/telephony/telephonyjstest/network_search/network_search_errors/Test.json index bc14c4c8c..a61145230 100644 --- a/telephony/telephonyjstest/network_search/network_search_errors/Test.json +++ b/telephony/telephonyjstest/network_search/network_search_errors/Test.json @@ -2,10 +2,9 @@ "description": "Configuration for NetworkSearch Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "1800", + "test-timeout": "1800000", "package": "com.ohos.networksearch", - "shell-timeout": "1800", - "native-test-timeout":"1800" + "shell-timeout": "60000" }, "kits": [ { diff --git a/telephony/telephonyjstest/network_search/network_search_errors/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/network_search/network_search_errors/entry/src/main/js/default/pages/index/index.js index f159d2674..8d813e891 100644 --- a/telephony/telephonyjstest/network_search/network_search_errors/entry/src/main/js/default/pages/index/index.js +++ b/telephony/telephonyjstest/network_search/network_search_errors/entry/src/main/js/default/pages/index/index.js @@ -37,7 +37,7 @@ export default { core.init() const configService = core.getDefaultService('config') - configService.timeout = 8000 + this.timeout = 30000 configService.setConfig(this) require('../../../test/List.test') core.execute() diff --git a/telephony/telephonyjstest/network_search/network_search_errors/entry/src/main/js/test/NetworkSearchErrors.test.js b/telephony/telephonyjstest/network_search/network_search_errors/entry/src/main/js/test/NetworkSearchErrors.test.js index ce7a40dc7..e579adb07 100644 --- a/telephony/telephonyjstest/network_search/network_search_errors/entry/src/main/js/test/NetworkSearchErrors.test.js +++ b/telephony/telephonyjstest/network_search/network_search_errors/entry/src/main/js/test/NetworkSearchErrors.test.js @@ -106,6 +106,13 @@ describe('ActsNetworkSearchTest', function () { radio.getNetworkState(SLOT_2, (err, data) => { if (err) { console.log(`Telephony_NetworkSearch_getNetworkState_Async_0700 finish err: ${err}`); + expect(data.longOperatorName != 'longOperatorName').assertTrue(); + expect(data.shortOperatorName != 'shortOperatorName').assertTrue(); + expect(data.plmnNumeric != 'plmnNumeric').assertTrue(); + expect(data.isRoaming != true).assertTrue(); + expect(data.regState != radio.REG_STATE_IN_SERVICE).assertTrue(); + expect(data.nsaState != radio.NSA_STATE_SA_ATTACHED).assertTrue(); + expect(data.isCaActive != true).assertTrue(); done(); return; } @@ -147,6 +154,10 @@ describe('ActsNetworkSearchTest', function () { return; } console.log(`Telephony_NetworkSearch_getSignalInformation_Async_0400 finish data: ${JSON.stringify(data)}`); + if (data.length > 0) { + expect(data[0].signalLevel != -1).assertTrue(); + expect(data[0].signalType != radio.NETWORK_TYPE_WCDMA).assertTrue(); + } expect(data.length === 0).assertTrue(); done(); }); @@ -262,11 +273,11 @@ describe('ActsNetworkSearchTest', function () { }); /** - * @tc.number Telephony_NetworkSearch_setNetworkSelectionMode_Async_0700 + * @tc.number Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0700 * @tc.name SlotId parameter input is -1, test setNetworkSelectionMode() query function go to the error * @tc.desc Function test */ - it('Telephony_NetworkSearch_setNetworkSelectionMode_Async_0700', 0, async function (done) { + it('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0700', 0, async function (done) { let networkSMode = { slotId: 55, //set the error slot id is 55 selectMode: radio.NETWORK_SELECTION_AUTOMATIC, @@ -279,7 +290,7 @@ describe('ActsNetworkSearchTest', function () { resumeSelection: false, }; console.log( - `Telephony_NetworkSearch_setNetworkSelectionMode_Async_0700 networkSMode:${JSON.stringify(networkSMode)}`) + `Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0700 networkSMode:${JSON.stringify(networkSMode)}`) try { await radio.setNetworkSelectionMode(networkSMode); console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0200 set fail'); @@ -299,6 +310,8 @@ describe('ActsNetworkSearchTest', function () { it('Telephony_NetworkSearch_getNetworkSearchInformation_Async_0400', 0, async function (done) { radio.getNetworkSearchInformation(SLOT_2, (err, data) => { if (err) { + expect(data.isNetworkSearchSuccess != true).assertTrue(); + expect(data.networkSearchResult != undefined).assertTrue(); console.log('Telephony_NetworkSearch_getNetworkSearchInformation_Async_0400 finish'); done(); } else { diff --git a/telephony/telephonyjstest/sim/sim_manager_function_test/Test.json b/telephony/telephonyjstest/sim/sim_manager_function_test/Test.json index 13e4b7159..5407e196a 100644 --- a/telephony/telephonyjstest/sim/sim_manager_function_test/Test.json +++ b/telephony/telephonyjstest/sim/sim_manager_function_test/Test.json @@ -2,10 +2,9 @@ "description": "Function test of sim manager interface", "driver": { "type": "JSUnitTest", - "test-timeout": "540000", + "test-timeout": "1800000", "package": "com.ohos.simmanagertest", - "shell-timeout": "540000", - "native-test-timeout":"540000" + "shell-timeout": "60000" }, "kits": [ { diff --git a/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/default/pages/index/index.js index 5e9c3a742..9c3a39b84 100644 --- a/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/default/pages/index/index.js +++ b/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/default/pages/index/index.js @@ -39,7 +39,7 @@ export default { core.init(); const configService = core.getDefaultService('config'); - configService.timeout = 8000 + this.timeout = 30000 configService.setConfig(this); require('../../../test/List.test'); diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_error/Test.json b/telephony/telephonyjstest/sms_mms/sms_mms_error/Test.json index 6b6f4c2cb..ee8dd6fef 100644 --- a/telephony/telephonyjstest/sms_mms/sms_mms_error/Test.json +++ b/telephony/telephonyjstest/sms_mms/sms_mms_error/Test.json @@ -2,10 +2,9 @@ "description": "Configuration for sms_mms demo Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "240000", + "test-timeout": "1800000", "package": "com.ohos.smsmms", - "shell-timeout": "240000", - "native-test-timeout":"240000" + "shell-timeout": "60000" }, "kits": [ { diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_error/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sms_mms/sms_mms_error/entry/src/main/js/default/pages/index/index.js index f16c40ec1..748782f1c 100644 --- a/telephony/telephonyjstest/sms_mms/sms_mms_error/entry/src/main/js/default/pages/index/index.js +++ b/telephony/telephonyjstest/sms_mms/sms_mms_error/entry/src/main/js/default/pages/index/index.js @@ -42,7 +42,7 @@ export default { core.init() const configService = core.getDefaultService('config') - configService.timeout = 60000 + this.timeout = 30000 configService.setConfig(this) require('../../../test/List.test') diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_error/entry/src/main/js/test/SmsMmsError.test.js b/telephony/telephonyjstest/sms_mms/sms_mms_error/entry/src/main/js/test/SmsMmsError.test.js index 34c3069d5..5c6334169 100644 --- a/telephony/telephonyjstest/sms_mms/sms_mms_error/entry/src/main/js/test/SmsMmsError.test.js +++ b/telephony/telephonyjstest/sms_mms/sms_mms_error/entry/src/main/js/test/SmsMmsError.test.js @@ -354,6 +354,10 @@ describe('SmsMmsErrorTest', function () { done(); return; } + if (result.length > 0) { + except(result[0].shortMessage != null).assertTrue(); + except(result[0].indexOnSim != -1).assertTrue(); + } expect(result === undefined || result.length === 0).assertTrue(); console.log('Telephony_SmsMms_getAllSIMMessages_Async_0200 finish'); done(); @@ -389,6 +393,16 @@ describe('SmsMmsErrorTest', function () { sms.createMessage(rawArrayNull, '3gpp', (err, shortMessage) => { if (err) { console.log('Telephony_SmsMms_createMessage_Async_0200 finish'); + except(shortMessage.visibleMessageBody != 'visibleMessageBody').assertTrue(); + except(shortMessage.visibleRawAddress != 'visibleRawAddress').assertTrue(); + except(shortMessage.messageClass != 'sms.FORWARD_MESSAGE').assertTrue(); + except(shortMessage.protocolId != -1).assertTrue(); + except(shortMessage.scAddress != 'scAddress').assertTrue(); + except(shortMessage.scTimestamp != -1).assertTrue(); + except(shortMessage.isReplaceMessage != true).assertTrue(); + except(shortMessage.hasReplyPath != true).assertTrue(); + except(shortMessage.status != -1).assertTrue(); + except(shortMessage.isSmsStatusReportMessage != true).assertTrue(); done(); return; } @@ -408,7 +422,9 @@ describe('SmsMmsErrorTest', function () { sms.sendMessage({ slotId: FALSE_SLOT_ID, destinationHost: SMS_SEND_DST_NUMBER, + serviceCenter: '', content: 'hello', + destinationPort: 0, sendCallback: (err, value) => { if (err) { expect().assertFail(); @@ -418,6 +434,7 @@ describe('SmsMmsErrorTest', function () { } console.log(`sendCallback success sendResult = ${value.result}`); expect(value.result === sms.SEND_SMS_FAILURE_UNKNOWN).assertTrue(); + expect(value.isLastPart != true).assertTrue(); console.log('Telephony_SmsMms_sendMessage_0200 finish'); done(); }, -- GitLab