diff --git a/telephony/telephonyjstest/BUILD.gn b/telephony/telephonyjstest/BUILD.gn index f1aa3363ff62cc64ea626e14fab8e153777aa92e..6593a125f04acfbec937c7c7a0b76f4a55275aaa 100644 --- a/telephony/telephonyjstest/BUILD.gn +++ b/telephony/telephonyjstest/BUILD.gn @@ -23,7 +23,8 @@ group("telephonyjstest") { "netmanager_http:ActsNetManagerHttpEtsTest", "netmanager_socket:ActsNetManagerSocketEtsTest", "network_search:network_search", - "new_add:ActsNewAddEtsTest", + "observer:ActsObserverEtsTest", + "radiostatistic:ActsRadiostatisticEtsTest", "sim:sim", "sms_mms:sms_mms", ] diff --git a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/entry/src/main/js/test/CallManageAll.test.js b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/entry/src/main/js/test/CallManageAll.test.js index b4782c54aed8d7d22ddf9304c9173300f5645ca5..294c2584535bde87cf47110e93d70b824babb59d 100644 --- a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/entry/src/main/js/test/CallManageAll.test.js +++ b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/entry/src/main/js/test/CallManageAll.test.js @@ -183,126 +183,7 @@ describe('CallManageImsCall', function () { callDetailsChangeOff(); console.log('Telephony_CallManager all 54 case is over for callmanager CallManageImsCall'); }); - - /** - * @tc.number Telephony_CallManager_IMS_combineConference_Async_0100 - * @tc.name Run the function combineConference by args callId CALL_ID_NOT_EXIST by callback, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_combineConference_Async_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_combineConference_Async_0100'; - call.combineConference(CALL_ID_NOT_EXIST, (error, data) => { - if (error) { - console.log(`${caseName} combineConference ${CALL_ID_NOT_EXIST} error,case success,error:${ - toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} combineConference success,case failed,data:${toString(data)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_combineConference_Promise_0100 - * @tc.name Run the function combineConference by args callId CALL_ID_NOT_EXIST by promise, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_combineConference_Promise_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_combineConference_Promise_0100'; - call.combineConference(CALL_ID_NOT_EXIST).then(data => { - expect().assertFail(); - console.log(`${caseName} combineConference success,case failed,data:${toString(data)}`); - done(); - }).catch(error => { - console.log(`${caseName} combineConference ${CALL_ID_NOT_EXIST} error,case success,error:${ - toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_separateConference_Async_0100 - * @tc.name Run the function separateConference by args callId CALL_ID_NOT_EXIST by callback, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_separateConference_Async_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_separateConference_Async_0100'; - call.separateConference(CALL_ID_NOT_EXIST, (error, data) => { - if (error) { - console.log(`${caseName} separateConference ${CALL_ID_NOT_EXIST} error,case success,error:${ - toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} separateConference success,case failed,data:${toString(data)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_separateConference_Promise_0100 - * @tc.name Run the function separateConference by args callId CALL_ID_NOT_EXIST by promise, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_separateConference_Promise_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_separateConference_Promise_0100'; - call.separateConference(CALL_ID_NOT_EXIST).then(data => { - expect().assertFail(); - console.log(`${caseName} separateConference success,case failed,data:${toString(data)}`); - done(); - }).catch(error => { - console.log(`${caseName} separateConference ${CALL_ID_NOT_EXIST} error,case success,error:${ - toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_joinConference_Async_0100 - * @tc.name Run the function joinConference by args mainCallId CALL_ID_NOT_EXIST, - * callNumberList PHONE_LIST2 by callback,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_joinConference_Async_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_joinConference_Async_0100'; - call.joinConference(CALL_ID_NOT_EXIST, PHONE_LIST2, (error, data) => { - if (error) { - console.log(`${caseName} joinConference ${CALL_ID_NOT_EXIST} error,case success,error:${ - toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} joinConference success,case failed,data:${toString(data)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_joinConference_Promise_0100 - * @tc.name Run the function joinConference by args mainCallId CALL_ID_NOT_EXIST, - * callNumberList PHONE_LIST2 by promise,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_joinConference_Promise_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_joinConference_Promise_0100'; - call.joinConference(CALL_ID_NOT_EXIST, PHONE_LIST2).then(data => { - expect().assertFail(); - console.log(`${caseName} joinConference success,case failed,data:${toString(data)}`); - done(); - }).catch(error => { - console.log(`${caseName} joinConference ${CALL_ID_NOT_EXIST} error,case success,error:${toString(error)}`); - done(); - }); - }); - + /** * @tc.number Telephony_CallManager_IMS_enableLteEnhanceMode_Async_0400 * @tc.name Run the function enableLteEnhanceMode by args slotId SLOT_ID_INVALID, @@ -491,1083 +372,175 @@ describe('CallManageImsCall', function () { }); }); - /** - * @tc.number Telephony_CallManager_IMS_updateImsCallMode_Async_0700 - * @tc.name Run function updateImsCallMode by args callId CALL_ID_NOT_EXIST, - * mode CALL_MODE_SEND_RECEIVE by callback,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_updateImsCallMode_Async_0700', 0, async function (done) { - let caseName = 'Telephony_CallManager_IMS_updateImsCallMode_Async_0700'; - call.updateImsCallMode(CALL_ID_NOT_EXIST, CALL_MODE_SEND_RECEIVE, (error, data) => { - if (error) { - console.log(`${caseName} updateImsCallMode2 error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} updateImsCallMode2 success,case failed,data:${toString(data)}`); - done(); - }); - }); /** - * @tc.number Telephony_CallManager_IMS_updateImsCallMode_Promise_0700 - * @tc.name Run function updateImsCallMode by args callId CALL_ID_NOT_EXIST, - * mode CALL_MODE_SEND_RECEIVE by promise, - * the function return error + * @tc.number Telephony_CallManager_controlCamera_Async_0200 + * @tc.name Dial a call and after answering the call,run function controlCamera by + * args cameraId CARMER_ID_NOT_EXIT by callback, + * the callback function return error * @tc.desc Function test */ - it('Telephony_CallManager_IMS_updateImsCallMode_Promise_0700', 0, async function (done) { - let caseName = 'Telephony_CallManager_IMS_updateImsCallMode_Promise_0700'; - call.updateImsCallMode(CALL_ID_NOT_EXIST, CALL_MODE_SEND_RECEIVE).then(data => { - expect().assertFail(); - console.log(`${caseName} updateImsCallMode success,case failed,data:${toString(data)}`); - done(); + it('Telephony_CallManager_controlCamera_Async_0200', 0, function (done) { + let caseName = 'Telephony_CallManager_controlCamera_Async_0200'; + scenceInCalling({ + caseName:caseName, + phoneNumber:AUTO_ACCEPT_NUMBER2, + checkState:CALL_STATUS_DIALING + }).then(data => { + callId = data.callId; + let cameraId = CARMER_ID_NOT_EXIT; + call.controlCamera(cameraId, (error) => { + if (error) { + console.log(`${caseName} error,case success,error:${toString(error)}`); + hangupCall2(caseName, done, callId); + return; + } + console.log(`${caseName} case failed`); + expect().assertFail(); + hangupCall2(caseName, done, callId); + }); }).catch(error => { - console.log(`${caseName} updateImsCallMode error,case success,error:${toString(error)}`); + console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); done(); }); }); /** - * @tc.number Telephony_CallManager_IMS_holdCall_Async_0100 - * @tc.name Run the function holdCall by args callId CALL_ID_NOT_EXIST by callback,the function return error + * @tc.number Telephony_CallManager_controlCamera_Promise_0200 + * @tc.name Dial a call and after answering the call,run function controlCamera by args cameraId + * CARMER_ID_NOT_EXIT by promise,the function return error * @tc.desc Function test */ - it('Telephony_CallManager_IMS_holdCall_Async_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_holdCall_Async_0100'; - call.holdCall(CALL_ID_NOT_EXIST, (error, data) => { - if (error) { - console.log(`${caseName} holdCall ${CALL_ID_NOT_EXIST} error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} holdCall success,case failed,data:${toString(data)}`); + it('Telephony_CallManager_controlCamera_Promise_0200', 0, async function (done) { + let caseName = 'Telephony_CallManager_controlCamera_Promise_0200'; + let cameraId = CARMER_ID_NOT_EXIT; + try { + let data = await scenceInCalling({ + caseName:caseName, + phoneNumber:AUTO_ACCEPT_NUMBER2, + checkState:CALL_STATUS_DIALING + }); + callId = data.callId; + } catch (error) { + console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); done(); - }); + return; + } + try { + await call.controlCamera(cameraId); + console.log(`${caseName} case failed`); + expect().assertFail(); + } catch (err) { + console.log(`${caseName} case success. error:${toString(err)}`); + } + hangupCall2(caseName, done, callId); }); /** - * @tc.number Telephony_CallManager_IMS_holdCall_Promise_0100 - * @tc.name Run the function holdCall by args callId CALL_ID_NOT_EXIST by promise,the function return error + * @tc.number Telephony_CallManager_setPreviewWindow_Async_0300 + * @tc.name Dial a call and after answering the call,run function setPreviewWindow by args + * x POS_700,y POS_10,z POS_Z_ERROR,width POS_LENGTH_300,height POS_LENGTH_600 by callback, + * the callback function return error * @tc.desc Function test */ - it('Telephony_CallManager_IMS_holdCall_Promise_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_holdCall_Promise_0100'; - call.holdCall(CALL_ID_NOT_EXIST).then(data => { - expect().assertFail(); - console.log(`${caseName} holdCall success,case failed,data:${toString(data)}`); - done(); + it('Telephony_CallManager_setPreviewWindow_Async_0300', 0, function (done) { + let caseName = 'Telephony_CallManager_setPreviewWindow_Async_0300'; + scenceInCalling({ + caseName:caseName, + phoneNumber:AUTO_ACCEPT_NUMBER, + checkState:CALL_STATUS_DIALING + }).then(data => { + callId = data.callId; + let info = {x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600}; + call.setPreviewWindow(info, (error) => { + if (error) { + console.log(`${caseName} error,case success,error:${toString(error)}`); + hangupCall2(caseName, done, callId); + return; + } + console.log(`${caseName} case faild`); + expect().assertFail(); + hangupCall2(caseName, done, callId); + }); }).catch(error => { - console.log(`${caseName} holdCall ${CALL_ID_NOT_EXIST} error,case success,error:${toString(error)}`); + console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); done(); }); }); /** - * @tc.number Telephony_CallManager_IMS_unHoldCall_Async_0100 - * @tc.name Run the function unHoldCall by args callId CALL_ID_NOT_EXIST by callback,the function return error + * @tc.number Telephony_CallManager_setPreviewWindow_Promise_0300 + * @tc.name Dial a call and after answering the call,run function setPreviewWindow by args + * x POS_700,y POS_10,z POS_Z_ERROR,width POS_LENGTH_300,height POS_LENGTH_600 by promise, + * the function return error * @tc.desc Function test */ - it('Telephony_CallManager_IMS_unHoldCall_Async_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_unHoldCall_Async_0100'; - call.unHoldCall(CALL_ID_NOT_EXIST, (error, data) => { - if (error) { - console.log(`${caseName} unHoldCall ${CALL_ID_NOT_EXIST} error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} unHoldCall success,case failed,data:${toString(data)}`); + it('Telephony_CallManager_setPreviewWindow_Promise_0300', 0, async function (done) { + let caseName = 'Telephony_CallManager_setPreviewWindow_Promise_0300'; + try { + let data = await scenceInCalling({ + caseName:caseName, + phoneNumber:AUTO_ACCEPT_NUMBER, + checkState:CALL_STATUS_DIALING + }); + callId = data.callId; + } catch (error) { + console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_unHoldCall_Promise_0100 - * @tc.name Run the function unHoldCall by args callId CALL_ID_NOT_EXIST by promise,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_unHoldCall_Promise_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_unHoldCall_Promise_0100'; - call.unHoldCall(CALL_ID_NOT_EXIST).then(data => { + return; + } + try { + let info = {x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600}; + await call.setPreviewWindow(info); + console.log(`${caseName} case faild`); expect().assertFail(); - console.log(`${caseName} unHoldCall success,case failed,data:${toString(data)}`); - done(); - }).catch(error => { - console.log(`${caseName} unHoldCall ${CALL_ID_NOT_EXIST} error,case success,error:${toString(error)}`); - done(); - }); + } catch (error) { + console.log(`${caseName} error,case success,error:${toString(error)}`); + } + hangupCall2(caseName, done, callId); }); /** - * @tc.number Telephony_CallManager_IMS_switchCall_Async_0100 - * @tc.name Run the function switchCall by args callId CALL_ID_NOT_EXIST by callback,the function return error + * @tc.number Telephony_CallManager_setDisplayWindow_Async_0300 + * @tc.name Dial a call and after answering the call,run function setDisplayWindow by args + * x POS_700,y POS_10,z POS_Z_ERROR,width POS_LENGTH_300,height POS_LENGTH_600 by callback, + * the callback function return error * @tc.desc Function test */ - it('Telephony_CallManager_IMS_switchCall_Async_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_switchCall_Async_0100'; - call.switchCall(CALL_ID_NOT_EXIST, (error, data) => { - if (error) { - console.log(`${caseName} switchCall ${CALL_ID_NOT_EXIST} error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} switchCall ${CALL_ID_NOT_EXIST} success,case failed,data:${toString(data)}`); + it('Telephony_CallManager_setDisplayWindow_Async_0300', 0, async function (done) { + let caseName = 'Telephony_CallManager_setDisplayWindow_Async_0300'; + try { + let data = await scenceInCalling({ + caseName:caseName, + phoneNumber:AUTO_ACCEPT_NUMBER, + checkState:CALL_STATUS_DIALING + }); + callId = data.callId; + } catch (error) { + console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_switchCall_Promise_0100 - * @tc.name Run the function switchCall by args callId CALL_ID_NOT_EXIST by promise,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_switchCall_Promise_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_switchCall_Promise_0100'; - call.switchCall(CALL_ID_NOT_EXIST).then(data => { + return; + } + try { + let info = {x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600}; + await call.setDisplayWindow(info); + console.log(`${caseName} case faild`); expect().assertFail(); - console.log(`${caseName} switchCall ${CALL_ID_NOT_EXIST} success,case failed,data:${toString(data)}`); - done(); - }).catch(error => { - console.log(`${caseName} switchCall ${CALL_ID_NOT_EXIST} error,case success,error:${toString(error)}`); - done(); - }); + } catch (error) { + console.log(`${caseName} error,case success,error:${toString(error)}`); + } + hangupCall2(caseName, done, callId); }); /** - * @tc.number Telephony_CallManager_IMS_USSD_dial_Async_0600 - * @tc.name Run the function dial by args phoneNumber COMMAND_CALL_ERROR options - * {accountId:DEFAULT_SLOT_ID,videoState:MEDIA_TYPE_VOICE,dialScene:DIAL_SCENCE_CALL_PRIVILEGED, - * dialType:DIAL_CARRIER_TYPE} by callback,the function return true + * @tc.number Telephony_CallManager_setDisplayWindow_Promise_0300 + * @tc.name Dial a call and after answering the call,run function setDisplayWindow by args + * x POS_700,y POS_10,z POS_Z_ERROR,width POS_LENGTH_300,height POS_LENGTH_600 by promise, + * the function return error * @tc.desc Function test */ - it('Telephony_CallManager_IMS_USSD_dial_Async_0600', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_USSD_dial_Async_0600'; - call.dial(COMMAND_CALL_ERROR, {accountId:DEFAULT_SLOT_ID, videoState:MEDIA_TYPE_VOICE, - dialScene:DIAL_SCENCE_CALL_PRIVILEGED, dialType:DIAL_CARRIER_TYPE}, (error, data) => { - if (error) { - expect().assertFail(); - console.log(`${caseName} dial error,case failed,error:${toString(error)}`); - done(); - return; - } - expect(data).assertTrue(); - console.log(`${caseName} dial success,case ${data === true ? 'success' : - 'failed'},data:${toString(data)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_USSD_dial_Promise_0600 - * @tc.name Run the function dial by args phoneNumber COMMAND_CALL_ERROR4 options - * {accountId:DEFAULT_SLOT_ID,videoState:MEDIA_TYPE_VOICE,dialScene:DIAL_SCENCE_CALL_PRIVILEGED, - * dialType:DIAL_CARRIER_TYPE} by promise,the function return true - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_USSD_dial_Promise_0600', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_USSD_dial_Promise_0600'; - call.dial(COMMAND_CALL_ERROR4, {accountId:DEFAULT_SLOT_ID, videoState:MEDIA_TYPE_VOICE, - dialScene:DIAL_SCENCE_CALL_PRIVILEGED, dialType:DIAL_CARRIER_TYPE}).then(data => { - expect(data).assertTrue(); - console.log(`${caseName} dial success,case ${data === true ? 'success' : 'failed'},data:${toString(data)}`); - done(); - }).catch(error => { - expect().assertFail(); - console.log(`${caseName} dial error,case failed,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_enableImsSwitch_Async_0400 - * @tc.name Run the function enableImsSwitch by args callId SLOT_ID_INVALID by callback,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_enableImsSwitch_Async_0400', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_enableImsSwitch_Async_0400'; - call.enableImsSwitch(SLOT_ID_INVALID, (error, data) => { - if (error) { - console.log(`${caseName} enableImsSwitch error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} enableImsSwitch success,case failed,data:${toString(data)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_enableImsSwitch_Promise_0400 - * @tc.name Run the function enableImsSwitch by args callId SLOT_ID_INVALID by promise,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_enableImsSwitch_Promise_0400', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_enableImsSwitch_Promise_0400'; - call.enableImsSwitch(SLOT_ID_INVALID).then(data => { - expect().assertFail(); - console.log(`${caseName} enableImsSwitch success,case failed,data:${toString(data)}`); - done(); - }).catch(error => { - console.log(`${caseName} enableImsSwitch error,case success,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_disableImsSwitch_Async_0600 - * @tc.name Run the function disableImsSwitch by args callId SLOT_ID_INVALID by callback, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_disableImsSwitch_Async_0600', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_disableImsSwitch_Async_0600'; - call.disableImsSwitch(SLOT_ID_INVALID, (error, data) => { - if (error) { - console.log(`${caseName} disableImsSwitch error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} disableImsSwitch success,case failed,data:${toString(data)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_disableImsSwitch_Promise_0600 - * @tc.name Run the function disableImsSwitch by args callId SLOT_ID_INVALID by promise,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_disableImsSwitch_Promise_0600', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_disableImsSwitch_Promise_0600'; - call.disableImsSwitch(SLOT_ID_INVALID).then(data => { - expect().assertFail(); - console.log(`${caseName} disableImsSwitch success,case failed,data:${toString(data)}`); - done(); - }).catch(error => { - console.log(`${caseName} disableImsSwitch error,case success,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_isImsSwitchEnabled_Async_0500 - * @tc.name Run the function isImsSwitchEnabled by args callId SLOT_ID_INVALID by callback, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_isImsSwitchEnabled_Async_0500', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_isImsSwitchEnabled_Async_0500'; - call.isImsSwitchEnabled(SLOT_ID_INVALID, (error, data) => { - if (error) { - console.log(`${caseName} isImsSwitchEnabled error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} isImsSwitchEnabled success,case failed,data:${toString(data)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_isImsSwitchEnabled_Promise_0500 - * @tc.name Run the function isImsSwitchEnabled by args callId SLOT_ID_INVALID by promise, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_isImsSwitchEnabled_Promise_0500', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_isImsSwitchEnabled_Promise_0500'; - call.isImsSwitchEnabled(SLOT_ID_INVALID).then(data => { - expect().assertFail(); - console.log(`${caseName} isImsSwitchEnabled success,case failed,data:${toString(data)}`); - done(); - }).catch(error => { - console.log(`${caseName} isImsSwitchEnabled error,case success,error:${toString(error)}`); - done(); - }); - }); - - - /** - * @tc.number Telephony_CallManager_IMS_setCallTransfer_Async_1300 - * @tc.name Run function setCallTransfer by args slotId SLOT_ID_INVALID,settingType CALL_TRANSFER_DISABLE, - * type TRANSFER_TYPE_NO_REPLY,transferNum PHONE_NUMBER_LENGTH_11 by callback, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_setCallTransfer_Async_1300', 0, async function (done) { - let caseName = 'Telephony_CallManager_IMS_setCallTransfer_Async_1300'; - call.setCallTransfer(SLOT_ID_INVALID, { - settingType:CALL_TRANSFER_DISABLE, - type:TRANSFER_TYPE_NO_REPLY, - transferNum:PHONE_NUMBER_LENGTH_11 - }, (error, data) => { - if (error) { - console.log(`${caseName} case success, error:${toString(error)}`); - done(); - return; - } - console.log(`${caseName} case failed,data:${toString(data)}`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_setCallTransfer_Promise_1300 - * @tc.name Run function setCallTransfer by args slotId SLOT_ID_INVALID,settingType CALL_TRANSFER_DISABLE, - * type TRANSFER_TYPE_UNCONDITIONAL,transferNum PHONE_NUMBER_AREA_LAND by promise, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_setCallTransfer_Promise_1300', 0, async function (done) { - let caseName = 'Telephony_CallManager_IMS_setCallTransfer_Promise_1300'; - try { - let data = await call.setCallTransfer(SLOT_ID_INVALID, { - settingType:CALL_TRANSFER_DISABLE, - type:TRANSFER_TYPE_UNCONDITIONAL, - transferNum:PHONE_NUMBER_AREA_LAND - }); - console.log(`${caseName} case failed,data:${toString(data)}`); - expect().assertFail(); - } catch (err) { - console.log(`${caseName} case success, err:${toString(err)}`); - } - done(); - }); - - /** - * @tc.number Telephony_CallManager_IMS_getCallTransferInfo_Async_1500 - * @tc.name Run function getCallTransferInfo by args slotId SLOT_ID_INVALID, - * type TRANSFER_TYPE_UNCONDITIONAL by callback, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_getCallTransferInfo_Async_1500', 0, async function (done) { - let caseName = 'Telephony_CallManager_IMS_getCallTransferInfo_Async_1500'; - call.getCallTransferInfo(SLOT_ID_INVALID, TRANSFER_TYPE_UNCONDITIONAL, (error, data) => { - if (error) { - console.log(`${caseName} getCallTransferInfo error, case success. error:${toString(error)}`); - done(); - return; - } - console.log(`${caseName} getCallTransferInfo success,case failed,data:${toString(data)}`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_getCallTransferInfo_Promise_1500 - * @tc.name Run function getCallTransferInfo by args slotId SLOT_ID_INVALID, - * type TRANSFER_TYPE_NOT_REACHABLE by promise, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_getCallTransferInfo_Promise_1500', 0, async function (done) { - let caseName = 'Telephony_CallManager_IMS_getCallTransferInfo_Promise_1500'; - try { - var data = await call.getCallTransferInfo(SLOT_ID_INVALID, TRANSFER_TYPE_NOT_REACHABLE); - console.log(`${caseName} case failed,data:${toString(data)}`); - expect().assertFail(); - } catch (err) { - console.log(`${caseName} case success. error:${toString(err)}`); - } - done(); - }); - - /** - * @tc.number Telephony_CallManager_IMS_setCallWaiting_Async_0700 - * @tc.name Run the function setCallWaiting by args slotId SLOT_ID_INVALID activate true by callback to open, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_setCallWaiting_Async_0700', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_setCallWaiting_Async_0700'; - call.setCallWaiting(SLOT_ID_INVALID, true, (error, data) => { - if (error) { - console.log(`${caseName} setCallWaiting error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} setCallWaiting success,case failed,data:${toString(data)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_setCallWaiting_Promise_0700 - * @tc.name Run the function setCallWaiting by args slotId SLOT_ID_INVALID activate true by promise to open, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_setCallWaiting_Promise_0700', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_setCallWaiting_Promise_0700'; - call.setCallWaiting(SLOT_ID_INVALID, true).then(data => { - expect().assertFail(); - console.log(`${caseName} setCallWaiting success,case failed,data:${toString(data)}`); - done(); - }).catch(error => { - console.log(`${caseName} setCallWaiting error,case success,error:${toString(error)}`); - done(); - }); - }); - - - /** - * @tc.number Telephony_CallManager_IMS_setCallRestriction_Async_1200 - * @tc.name Run function setCallRestriction by callback - * by arg slotId SLOT_ID_INVALID type RESTRICTION_TYPE_ALL_INCOMING password RIGHT_PASSWORD - * mode RESTRICTION_MODE_ACTIVATION,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_setCallRestriction_Async_1200', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_setCallRestriction_Async_1200'; - call.setCallRestriction(SLOT_ID_INVALID, { - type:RESTRICTION_TYPE_ALL_INCOMING, - password:RIGHT_PASSWORD, - mode:RESTRICTION_MODE_ACTIVATION - }, (error, data) => { - if (error) { - console.log(`${caseName} success,case ${error ? 'success' : 'failed'},error:${toString(error)}`); - expect(!!error).assertTrue(); - done(); - return; - } - console.log(`${caseName} error,case failed,data:${toString(data)}`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_setCallRestriction_Promise_1200 - * @tc.name Run function setCallRestriction by promise - * by arg slotId SLOT_ID_INVALID type RESTRICTION_TYPE_ALL_INCOMING password RIGHT_PASSWORD - * mode RESTRICTION_MODE_ACTIVATION,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_setCallRestriction_Promise_1200', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_setCallRestriction_Promise_1200'; - call.setCallRestriction(SLOT_ID_INVALID, { - type:RESTRICTION_TYPE_ALL_INCOMING, - password:RIGHT_PASSWORD, - mode:RESTRICTION_MODE_ACTIVATION - }) - .then(data => { - console.log(`${caseName} error,case failed,data:${toString(data)}`); - expect().assertFail(); - done(); - }) - .catch((error) => { - console.log(`${caseName} success,case ${error ? 'success' : 'failed'},error:${toString(error)}`); - expect(!!error).assertTrue(); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_getCallRestrictionStatus_Async_1100 - * @tc.name Run function getCallRestrictionStatus by callback by arg slotId - * that is SLOT_ID_INVALID CallRestrictionType RESTRICTION_TYPE_ROAMING_INCOMING , - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_getCallRestrictionStatus_Async_1100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_getCallRestrictionStatus_Async_1100'; - call.getCallRestrictionStatus(SLOT_ID_INVALID, RESTRICTION_TYPE_ROAMING_INCOMING, (error, data) => { - if (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - done(); - return; - } - console.log(`${caseName} success,case faild,data:${toString(data)}`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_getCallRestrictionStatus_Promise_1100 - * @tc.name Run function getCallRestrictionStatus by promise by arg slotId (that is at SLOT_ID_INVALID) - * CallRestrictionType RESTRICTION_TYPE_ROAMING_INCOMING , - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_getCallRestrictionStatus_Promise_1100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_getCallRestrictionStatus_Promise_1100'; - call.getCallRestrictionStatus(SLOT_ID_INVALID, RESTRICTION_TYPE_ROAMING_INCOMING) - .then(data => { - console.log(`${caseName} success,case failed,data:${toString(data)}`); - expect().assertFail(); - done(); - }) - .catch(error => { - console.log(`${caseName} error,case success,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_getCallWaitingStatus_Async_0500 - * @tc.name Run the function getCallWaitingStatus by args slotId SLOT_ID_INVALID by callback, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_getCallWaitingStatus_Async_0500', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_getCallWaitingStatus_Async_0500'; - call.getCallWaitingStatus(SLOT_ID_INVALID, (error, data) => { - if (error) { - console.log(`${caseName} getCallWaitingStatus error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} getCallWaitingStatus success,case failed,data:${toString(data)}`); - done(); - }); - }); - - - /** - * @tc.number Telephony_CallManager_IMS_getCallWaitingStatus_Promise_0500 - * @tc.name Run the function getCallWaitingStatus by args slotId SLOT_ID_INVALID by promise, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_getCallWaitingStatus_Promise_0500', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_getCallWaitingStatus_Promise_0500'; - call.getCallWaitingStatus(SLOT_ID_INVALID).then(data => { - expect().assertFail(); - console.log(`${caseName} getCallWaitingStatus success,case failed,data:${toString(data)}`); - done(); - }).catch(error => { - console.log(`${caseName} getCallWaitingStatus error,case success,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_controlCamera_Async_0200 - * @tc.name Dial a call and after answering the call,run function controlCamera by - * args cameraId CARMER_ID_NOT_EXIT by callback, - * the callback function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_controlCamera_Async_0200', 0, function (done) { - let caseName = 'Telephony_CallManager_controlCamera_Async_0200'; - scenceInCalling({ - caseName:caseName, - phoneNumber:AUTO_ACCEPT_NUMBER2, - checkState:CALL_STATUS_DIALING - }).then(data => { - callId = data.callId; - let cameraId = CARMER_ID_NOT_EXIT; - call.controlCamera(cameraId, (error) => { - if (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - hangupCall2(caseName, done, callId); - return; - } - console.log(`${caseName} case failed`); - expect().assertFail(); - hangupCall2(caseName, done, callId); - }); - }).catch(error => { - console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_controlCamera_Promise_0200 - * @tc.name Dial a call and after answering the call,run function controlCamera by args cameraId - * CARMER_ID_NOT_EXIT by promise,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_controlCamera_Promise_0200', 0, async function (done) { - let caseName = 'Telephony_CallManager_controlCamera_Promise_0200'; - let cameraId = CARMER_ID_NOT_EXIT; - try { - let data = await scenceInCalling({ - caseName:caseName, - phoneNumber:AUTO_ACCEPT_NUMBER2, - checkState:CALL_STATUS_DIALING - }); - callId = data.callId; - } catch (error) { - console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); - done(); - return; - } - try { - await call.controlCamera(cameraId); - console.log(`${caseName} case failed`); - expect().assertFail(); - } catch (err) { - console.log(`${caseName} case success. error:${toString(err)}`); - } - hangupCall2(caseName, done, callId); - }); - - /** - * @tc.number Telephony_CallManager_setPreviewWindow_Async_0300 - * @tc.name Dial a call and after answering the call,run function setPreviewWindow by args - * x POS_700,y POS_10,z POS_Z_ERROR,width POS_LENGTH_300,height POS_LENGTH_600 by callback, - * the callback function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_setPreviewWindow_Async_0300', 0, function (done) { - let caseName = 'Telephony_CallManager_setPreviewWindow_Async_0300'; - scenceInCalling({ - caseName:caseName, - phoneNumber:AUTO_ACCEPT_NUMBER, - checkState:CALL_STATUS_DIALING - }).then(data => { - callId = data.callId; - let info = {x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600}; - call.setPreviewWindow(info, (error) => { - if (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - hangupCall2(caseName, done, callId); - return; - } - console.log(`${caseName} case faild`); - expect().assertFail(); - hangupCall2(caseName, done, callId); - }); - }).catch(error => { - console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_setPreviewWindow_Promise_0300 - * @tc.name Dial a call and after answering the call,run function setPreviewWindow by args - * x POS_700,y POS_10,z POS_Z_ERROR,width POS_LENGTH_300,height POS_LENGTH_600 by promise, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_setPreviewWindow_Promise_0300', 0, async function (done) { - let caseName = 'Telephony_CallManager_setPreviewWindow_Promise_0300'; - try { - let data = await scenceInCalling({ - caseName:caseName, - phoneNumber:AUTO_ACCEPT_NUMBER, - checkState:CALL_STATUS_DIALING - }); - callId = data.callId; - } catch (error) { - console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); - done(); - return; - } - try { - let info = {x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600}; - await call.setPreviewWindow(info); - console.log(`${caseName} case faild`); - expect().assertFail(); - } catch (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - } - hangupCall2(caseName, done, callId); - }); - - /** - * @tc.number Telephony_CallManager_setDisplayWindow_Async_0300 - * @tc.name Dial a call and after answering the call,run function setDisplayWindow by args - * x POS_700,y POS_10,z POS_Z_ERROR,width POS_LENGTH_300,height POS_LENGTH_600 by callback, - * the callback function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_setDisplayWindow_Async_0300', 0, async function (done) { - let caseName = 'Telephony_CallManager_setDisplayWindow_Async_0300'; - try { - let data = await scenceInCalling({ - caseName:caseName, - phoneNumber:AUTO_ACCEPT_NUMBER, - checkState:CALL_STATUS_DIALING - }); - callId = data.callId; - } catch (error) { - console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); - done(); - return; - } - try { - let info = {x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600}; - await call.setDisplayWindow(info); - console.log(`${caseName} case faild`); - expect().assertFail(); - } catch (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - } - hangupCall2(caseName, done, callId); - }); - - /** - * @tc.number Telephony_CallManager_setDisplayWindow_Promise_0300 - * @tc.name Dial a call and after answering the call,run function setDisplayWindow by args - * x POS_700,y POS_10,z POS_Z_ERROR,width POS_LENGTH_300,height POS_LENGTH_600 by promise, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_setDisplayWindow_Promise_0300', 0, async function (done) { - let caseName = 'Telephony_CallManager_setDisplayWindow_Promise_0300'; - try { - let data = await scenceInCalling({ - caseName:caseName, - phoneNumber:AUTO_ACCEPT_NUMBER, - checkState:CALL_STATUS_DIALING - }); - callId = data.callId; - } catch (error) { - console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); - done(); - return; - } - try { - let info = {x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600}; - await call.setDisplayWindow(info); - console.log(`${caseName} case faild`); - expect().assertFail(); - } catch (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - } - hangupCall2(caseName, done, callId); - }); - - /** - * @tc.number Telephony_CallManager_setCameraZoom_Async_0400 - * @tc.name Dial a call and after answering the call,run function setCameraZoom by args - * zoomRatio ZOOM_RATIO_MINUS_1_0 by callback,the callback function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_setCameraZoom_Async_0400', 0, function (done) { - let caseName = 'Telephony_CallManager_setCameraZoom_Async_0400'; - scenceInCalling({ - caseName:caseName, - phoneNumber:AUTO_ACCEPT_NUMBER2, - checkState:CALL_STATUS_DIALING - }).then(data => { - callId = data.callId; - call.setCameraZoom(ZOOM_RATIO_MINUS_1_0, (error) => { - if (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - hangupCall2(caseName, done, callId); - return; - } - console.log(`${caseName} case failed`); - expect().assertFail(); - hangupCall2(caseName, done, callId); - }); - }).catch(error => { - console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_setCameraZoom_Promise_0400 - * @tc.name Dial a call and after answering the call,run function setCameraZoom by args - * zoomRatio ZOOM_RATIO_MINUS_1_0 by promise,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_setCameraZoom_Promise_0400', 0, async function (done) { - let caseName = 'Telephony_CallManager_setCameraZoom_Promise_0400'; - try { - let data = await scenceInCalling({ - caseName:caseName, - phoneNumber:AUTO_ACCEPT_NUMBER, - checkState:CALL_STATUS_DIALING - }); - callId = data.callId; - } catch (error) { - console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); - done(); - return; - } - try { - await call.setCameraZoom(ZOOM_RATIO_MINUS_1_0); - console.log(`${caseName} case failed`); - expect().assertFail(); - } catch (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - } - hangupCall2(caseName, done, callId); - }); - - /** - * @tc.number Telephony_CallManager_setPausePicture_Async_0500 - * @tc.name Dial a call and after answering the call,run function setPausePicture by args - * path IMAGE_LOCAL_ERROR_PATH by callback,the callback function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_setPausePicture_Async_0500', 0, function (done) { - let caseName = 'Telephony_CallManager_setPausePicture_Async_0500'; - scenceInCalling({ - caseName:caseName, - phoneNumber:AUTO_ACCEPT_NUMBER, - checkState:CALL_STATUS_DIALING - }).then(data => { - callId = data.callId; - call.setPausePicture(IMAGE_LOCAL_ERROR_PATH, (error) => { - if (error) { - console.log(`${caseName} case success,error:${toString(error)}`); - hangupCall2(caseName, done, callId); - return; - } - console.log(`${caseName} success,case failed`); - hangupCall2(caseName, done, callId); - }); - }).catch(error => { - console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_setPausePicture_Promise_0500 - * @tc.name Dial a call and after answering the call,run function setPausePicture - * by args path IMAGE_LOCAL_ERROR_PATH by promise, - * the callback function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_setPausePicture_Promise_0500', 0, async function (done) { - let caseName = 'Telephony_CallManager_setPausePicture_Promise_0500'; - try { - let data = await scenceInCalling({ - caseName:caseName, - phoneNumber:AUTO_ACCEPT_NUMBER, - checkState:CALL_STATUS_DIALING - }); - callId = data.callId; - } catch (error) { - console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); - done(); - return; - } - try { - await call.setPausePicture(IMAGE_LOCAL_ERROR_PATH); - console.log(`${caseName} success,case failed`); - } catch (error) { - console.log(`${caseName} case success,error:${toString(error)}`); - } - hangupCall2(caseName, done, callId); - }); - - /** - * @tc.number Telephony_CallManager_setDeviceDirection_Async_0500 - * @tc.name Dial a call and after answering the call,run function setDeviceDirection - * by args rotation ROTATION_MINUS_1 by callback,the callback function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_setDeviceDirection_Async_0500', 0, function (done) { - let caseName = 'Telephony_CallManager_setDeviceDirection_Async_0500'; - scenceInCalling({ - caseName:caseName, - phoneNumber:AUTO_ACCEPT_NUMBER, - checkState:CALL_STATUS_DIALING - }).then(data => { - callId = data.callId; - call.setDeviceDirection(ROTATION_MINUS_1, (error) => { - if (error) { - console.log(`${caseName} success, case success`); - hangupCall2(caseName, done, callId); - return; - } - console.log(`${caseName} error,case failed,error:${toString(error)}`); - expect().assertFail(); - hangupCall2(caseName, done, callId); - }); - }).catch(error => { - console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_setDeviceDirection_Promise_0500 - * @tc.name Dial a call and after answering the call,run function setDeviceDirection - * by args rotation ROTATION_MINUS_1 by promise,the callback function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_setDeviceDirection_Promise_0500', 0, async function (done) { - let caseName = 'Telephony_CallManager_setDeviceDirection_Promise_0500'; - try { - let data = await scenceInCalling({ - caseName:caseName, - phoneNumber:AUTO_ACCEPT_NUMBER2, - checkState:CALL_STATUS_DIALING - }); - callId = data.callId; - } catch (error) { - console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); - done(); - return; - } - try { - await call.setDeviceDirection(ROTATION_MINUS_1); - console.log(`${caseName} success,case error`); - expect().assertFail(); - } catch (error) { - console.log(`${caseName} case success,error:${toString(error)}`); - } - hangupCall2(caseName, done, callId); - }); - - /** - * @tc.number Telephony_CallManager_IMS_dial_Async_0600 - * @tc.name Dial a call by function dial by args phoneNumber NULL_PHONE_NUMBER options - * {accountId: DEFAULT_SLOT_ID, videoState: MEDIA_TYPE_VOICE, dialScene: DIAL_SCENCE_CALL_PRIVILEGED, - * dialType:DIAL_CARRIER_TYPE} by callback,the callback function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_dial_Async_0600', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_dial_Async_0600'; - let flag = true; - reachState(caseName, CALL_STATUS_DIALING, '', false).then(data => { - callId = data.callId; - console.log(`${caseName} reachState success,case failed,data:${toString(data)}`); - expect().assertFail(); - hangupCall2(caseName, done, callId); - }).catch(error => { - console.log(`${caseName} reachState error,case ${flag ? 'success' : 'failed'},error:${toString(error)}`); - expect(flag).assertTrue(); - done(); - }); - let obj = {accountId: DEFAULT_SLOT_ID, videoState: MEDIA_TYPE_VOICE, - dialScene: DIAL_SCENCE_CALL_PRIVILEGED, dialType:DIAL_CARRIER_TYPE}; - call.dial(NULL_PHONE_NUMBER, obj, (error, data) => { - if (error) { - console.log(`${caseName} dial error,error:${toString(error)}`); - flag = true; - return; - } - flag = false; - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_dial_Promise_0100 - * @tc.name Dial a call by function dial by args phoneNumber PHONE_NUMBER_LONG by promise, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_dial_Promise_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_dial_Promise_0100'; - let flag = true; - reachState(caseName, CALL_STATUS_DIALING, '', false).then(data => { - callId = data.callId; - console.log(`${caseName} reachState success,case failed,data:${toString(data)}`); - expect().assertFail(); - hangupCall2(caseName, done, callId); - }).catch(error => { - console.log(`${caseName} reachState error,case ${flag ? 'success' : 'failed'},error:${toString(error)}`); - expect(flag).assertTrue(); - done(); - }); - call.dial(PHONE_NUMBER_LONG).then(data => { - flag = false; - }).catch(error => { - console.log(`${caseName} dial error,error:${toString(error)}`); - flag = true; - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_answer_Async_0100 - * @tc.name Run function answer by args callId BOUNDARY_NUMBER_INT by callback, - * the callback function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_answer_Async_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_answer_Async_0100'; - call.answer(BOUNDARY_NUMBER_INT, (error) => { - if (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} success,case failed`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_answer_Promise_0100 - * @tc.name Run function answer by args callId CALL_ID_NOT_EXIST by promise, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_answer_Promise_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_answer_Promise_0100'; - call.answer(CALL_ID_NOT_EXIST).then(() => { - expect().assertFail(); - console.log(`${caseName} success,case failed`); - done(); - }).catch(error => { - console.log(`${caseName} error,case success,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_reject_Async_0100 - * @tc.name Run function reject by args callId BOUNDARY_NUMBER_INT by callback, - * the callback function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_reject_Async_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_reject_Async_0100'; - call.reject(BOUNDARY_NUMBER_INT, (error) => { - if (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} success,case failed`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_reject_Promise_0100 - * @tc.name Run function reject by args callId CALL_ID_NOT_EXIST by promise, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_reject_Promise_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_reject_Promise_0100'; - call.reject(CALL_ID_NOT_EXIST).then(() => { - expect().assertFail(); - console.log(`${caseName} success,case failed`); - done(); - }).catch(error => { - console.log(`${caseName} error,case success,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_reject_Promise_0400 - * @tc.name Test the function runs 10 times, stability test - * @tc.desc Function test - */ - it('Telephony_CallManager_reject_Promise_0400', 0, async function (done) { - let caseName = 'Telephony_CallManager_reject_Promise_0400'; - let callId = null; + it('Telephony_CallManager_setDisplayWindow_Promise_0300', 0, async function (done) { + let caseName = 'Telephony_CallManager_setDisplayWindow_Promise_0300'; try { let data = await scenceInCalling({ caseName:caseName, @@ -1575,130 +548,45 @@ describe('CallManageImsCall', function () { checkState:CALL_STATUS_DIALING }); callId = data.callId; - try { - data = await call.reject(callId, new RejectMessageOptions(REJECT_MESSAGE_STR)); - console.log(`${caseName} reject success,case failed,data:${toString(data)}`); - done(); - } catch (err) { - console.log(`${caseName} reject error,case success,err:${toString(err)}`); - done(); - } } catch (error) { - console.log(`${caseName} scenceInCalling error,case failed,error:${toString(error)}`); + console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); done(); + return; } - }); - - /** - * @tc.number Telephony_CallManager_reject_Async_0400 - * @tc.name Test the function runs 10 times, stability test - * @tc.desc Function test - */ - it('Telephony_CallManager_reject_Async_0400', 0, async function (done) { - let caseName = 'Telephony_CallManager_reject_Async_0400'; - let callId = null; try { - let data = await scenceInCalling({ - caseName:caseName, - phoneNumber:AUTO_ACCEPT_NUMBER, - checkState:CALL_STATUS_DIALING - }); - callId = data.callId; - call.reject(callId, new RejectMessageOptions(REJECT_MESSAGE_NUM), (err, data) => { - if (err) { - console.log(`${caseName} reject error,case success,err:${toString(err)}`); - done(); - return; - } - console.log(`${caseName} reject success,case failed,data:${toString(data)}`); - done(); - }); - } catch (error) { - console.log(`${caseName} scenceInCalling error,case failed,error:${toString(error)}`); - done(); - } - }); - - /** - * @tc.number Telephony_CallManager_IMS_hangup_Async_0100 - * @tc.name Run function hangup by args callId BOUNDARY_NUMBER_INT by callback, - * the callback function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_hangup_Async_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_hangup_Async_0100'; - call.hangup(BOUNDARY_NUMBER_INT, (error) => { - if (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} success,case failed`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_hangup_Promise_0100 - * @tc.name Run function hangup by args callId CALL_ID_NOT_EXIST by promise, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_hangup_Promise_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_hangup_Promise_0100'; - call.hangup(CALL_ID_NOT_EXIST).then(() => { + let info = {x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600}; + await call.setDisplayWindow(info); + console.log(`${caseName} case faild`); expect().assertFail(); - console.log(`${caseName} success,case failed`); - done(); - }).catch(error => { + } catch (error) { console.log(`${caseName} error,case success,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_startDTMF_Async_1300 - * @tc.name Run function startDTMF by args callId MINUS_VALUE character C by callback, - * the callback function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_startDTMF_Async_1300', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_startDTMF_Async_1300'; - call.startDTMF(MINUS_VALUE, SENT_STRING_C, (error) => { - if (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} success,case failed`); - done(); - }); + } + hangupCall2(caseName, done, callId); }); /** - * @tc.number Telephony_CallManager_IMS_startDTMF_Promise_1300 - * @tc.name Dial a call by function dial by args phoneNumber PHONE_NUMBER_LENGTH_11 when before being accepted, - * run function startDTMF by args callId BOUNDARY_NUMBER_INT character C by promise, - * the function return error + * @tc.number Telephony_CallManager_setCameraZoom_Async_0400 + * @tc.name Dial a call and after answering the call,run function setCameraZoom by args + * zoomRatio ZOOM_RATIO_MINUS_1_0 by callback,the callback function return error * @tc.desc Function test */ - it('Telephony_CallManager_IMS_startDTMF_Promise_1300', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_startDTMF_Promise_1300'; + it('Telephony_CallManager_setCameraZoom_Async_0400', 0, function (done) { + let caseName = 'Telephony_CallManager_setCameraZoom_Async_0400'; scenceInCalling({ caseName:caseName, - phoneNumber:PHONE_NUMBER_LENGTH_11, + phoneNumber:AUTO_ACCEPT_NUMBER2, checkState:CALL_STATUS_DIALING }).then(data => { callId = data.callId; - call.startDTMF(BOUNDARY_NUMBER_INT, SENT_STRING_C).then(data => { - console.log(`${caseName} success,case error,data:${toString(data)}`); + call.setCameraZoom(ZOOM_RATIO_MINUS_1_0, (error) => { + if (error) { + console.log(`${caseName} error,case success,error:${toString(error)}`); + hangupCall2(caseName, done, callId); + return; + } + console.log(`${caseName} case failed`); expect().assertFail(); hangupCall2(caseName, done, callId); - }).catch(error => { - console.log(`${caseName} case success`); - hangupCall2(caseName, done, callId); }); }).catch(error => { console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); @@ -1707,277 +595,152 @@ describe('CallManageImsCall', function () { }); /** - * @tc.number Telephony_CallManager_IMS_stopDTMF_Async_0100 - * @tc.name Run function stopDTMF by args callId CALL_ID_NOT_EXIST by callback,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_stopDTMF_Async_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_stopDTMF_Async_0100'; - call.stopDTMF(CALL_ID_NOT_EXIST, (error, data) => { - if (error) { - console.log(`${caseName} case success`); - done(); - return; - } - console.log(`${caseName} success,case error,data:${toString(data)}`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_IMS_stopDTMF_Promise_0100 - * @tc.name Run function stopDTMF by args callId BOUNDARY_NUMBER_INT by promise,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_stopDTMF_Promise_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_stopDTMF_Promise_0100'; - call.stopDTMF(BOUNDARY_NUMBER_INT).then(data => { - console.log(`${caseName} success,case error,data:${toString(data)}`); - expect().assertFail(); - done(); - }).catch(error => { - console.log(`${caseName} error,case success,error:${toString(error)}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_muteRinger_Async_0100 - * @tc.name Unwanted state,run function muteRinger by callback,the function return void - * @tc.desc Function test - */ - it('Telephony_CallManager_muteRinger_Async_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_muteRinger_Async_0100'; - call.muteRinger((error, data) => { - if (error) { - console.log(`${caseName} error,case failed,error:${toString(error)}`); - expect().assertFail(); - done(); - return; - } - console.log(`${caseName} success,case success`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_muteRinger_Promise_0100 - * @tc.name Unwanted state,run function muteRinger by promise,the function return void - * @tc.desc Function test - */ - it('Telephony_CallManager_muteRinger_Promise_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_muteRinger_Promise_0100'; - call.muteRinger() - .then(data => { - console.log(`${caseName} success,case success`); - done(); - }) - .catch((error) => { - console.log(`${caseName} error,case failed,error:${toString(error)}`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_setAudioDevice_Async_0500 - * @tc.name Unwanted state,run function setAudioDevice by callback and by arg DEVICE_EARPIECE, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_setAudioDevice_Async_0500', 0, function (done) { - let caseName = 'Telephony_CallManager_setAudioDevice_Async_0500'; - call.setAudioDevice(DEVICE_EARPIECE, (error, data) => { - if (error) { - console.log(`${caseName} success,case ${error ? 'success' : 'failed'},error:${toString(error)}`); - expect(!!error).assertTrue(); - done(); - return; - } - console.log(`${caseName} error,case failed,data:${toString(data)}`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_setAudioDevice_Promise_0500 - * @tc.name Unwanted state,run function setAudioDevice by promise and by arg DEVICE_EARPIECE, - * the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_setAudioDevice_Promise_0500', 0, function (done) { - let caseName = 'Telephony_CallManager_setAudioDevice_Promise_0500'; - call.setAudioDevice(DEVICE_EARPIECE) - .then(data => { - console.log(`${caseName} error,case failed,data:${toString(data)}`); - expect().assertFail(); - done(); - }) - .catch(error => { - console.log(`${caseName} success,case ${error ? 'success' : 'failed'},error:${toString(error)}`); - expect(!!error).assertTrue(); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_setMuted_Async_0300 - * @tc.name Unwanted state,run function setMuted by callback,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_setMuted_Async_0300', 0, function (done) { - let caseName = 'Telephony_CallManager_setMuted_Async_0300'; - call.setMuted((error, data) => { - if (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - expect(!!error).assertTrue(); - done(); - return; - } - console.log(`${caseName} success,case failed,data:${toString(data)}`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_setMuted_Promise_0300 - * @tc.name Unwanted state,run function setMuted by promise,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_setMuted_Promise_0300', 0, function (done) { - let caseName = 'Telephony_CallManager_setMuted_Promise_0300'; - call.setMuted() - .then(data => { - console.log(`${caseName} success,case failed,data:${toString(data)}`); - expect().assertFail(); - done(); - }) - .catch(error => { - console.log(`${caseName} error,case success,error:${toString(error)}`); - expect(!!error).assertTrue(); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_cancelMuted_Async_0300 - * @tc.name Unwanted state,run function cancelMuted by callback,the function return error + * @tc.number Telephony_CallManager_setCameraZoom_Promise_0400 + * @tc.name Dial a call and after answering the call,run function setCameraZoom by args + * zoomRatio ZOOM_RATIO_MINUS_1_0 by promise,the function return error * @tc.desc Function test */ - it('Telephony_CallManager_cancelMuted_Async_0300', 0, function (done) { - let caseName = 'Telephony_CallManager_cancelMuted_Async_0300'; - call.cancelMuted((error, data) => { - if (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - done(); - return; - } - console.log(`${caseName} success,case failed,data:${toString(data)}`); - expect().assertFail(); + it('Telephony_CallManager_setCameraZoom_Promise_0400', 0, async function (done) { + let caseName = 'Telephony_CallManager_setCameraZoom_Promise_0400'; + try { + let data = await scenceInCalling({ + caseName:caseName, + phoneNumber:AUTO_ACCEPT_NUMBER, + checkState:CALL_STATUS_DIALING + }); + callId = data.callId; + } catch (error) { + console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); done(); - }); + return; + } + try { + await call.setCameraZoom(ZOOM_RATIO_MINUS_1_0); + console.log(`${caseName} case failed`); + expect().assertFail(); + } catch (error) { + console.log(`${caseName} error,case success,error:${toString(error)}`); + } + hangupCall2(caseName, done, callId); }); /** - * @tc.number Telephony_CallManager_cancelMuted_Promise_0300 - * @tc.name Unwanted state,run function cancelMuted by promise,the function return error + * @tc.number Telephony_CallManager_setPausePicture_Async_0500 + * @tc.name Dial a call and after answering the call,run function setPausePicture by args + * path IMAGE_LOCAL_ERROR_PATH by callback,the callback function return error * @tc.desc Function test */ - it('Telephony_CallManager_cancelMuted_Promise_0300', 0, function (done) { - let caseName = 'Telephony_CallManager_cancelMuted_Promise_0300'; - call.cancelMuted() - .then(data => { - console.log(`${caseName} success,case failed,data:${toString(data)}`); - expect().assertFail(); - done(); - }) - .catch(error => { - console.log(`${caseName} error,case success,error:${toString(error)}`); - done(); + it('Telephony_CallManager_setPausePicture_Async_0500', 0, function (done) { + let caseName = 'Telephony_CallManager_setPausePicture_Async_0500'; + scenceInCalling({ + caseName:caseName, + phoneNumber:AUTO_ACCEPT_NUMBER, + checkState:CALL_STATUS_DIALING + }).then(data => { + callId = data.callId; + call.setPausePicture(IMAGE_LOCAL_ERROR_PATH, (error) => { + if (error) { + console.log(`${caseName} case success,error:${toString(error)}`); + hangupCall2(caseName, done, callId); + return; + } + console.log(`${caseName} success,case failed`); + hangupCall2(caseName, done, callId); }); - }); - - /** - * @tc.number Telephony_CallManager_isNewCallAllowed_Async_0200 - * @tc.name Unwanted state ,run the function isNewCallAllowed by callback ,the function return true - * @tc.desc Function test - */ - it('Telephony_CallManager_isNewCallAllowed_Async_0200', 0, function (done) { - let caseName = 'Telephony_CallManager_isNewCallAllowed_Async_0200'; - call.isNewCallAllowed(function (error, data) { - if (error) { - console.log(`${caseName} error,case failed,error:${toString(error)}`); - expect().assertFail(); - done(); - return; - } - console.log(`${caseName} success,case ${data === true ? 'success' : 'failed'},data:${toString(data)}`); - expect(data === true).assertTrue(); + }).catch(error => { + console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); done(); }); }); /** - * @tc.number Telephony_CallManager_isNewCallAllowed_Promise_0200 - * @tc.name Unwanted state ,run the function isNewCallAllowed by promise ,the function return true + * @tc.number Telephony_CallManager_setPausePicture_Promise_0500 + * @tc.name Dial a call and after answering the call,run function setPausePicture + * by args path IMAGE_LOCAL_ERROR_PATH by promise, + * the callback function return error * @tc.desc Function test */ - it('Telephony_CallManager_isNewCallAllowed_Promise_0200', 0, function (done) { - let caseName = 'Telephony_CallManager_isNewCallAllowed_Promise_0200'; - call.isNewCallAllowed() - .then(data => { - console.log(`${caseName} success,case ${data === true ? 'success' : 'failed'},data:${toString(data)}`); - expect(data === true).assertTrue(); - done(); - }) - .catch(error => { - console.log(`${caseName} error,case failed,error:${toString(error)}`); - expect().assertFail(); - done(); + it('Telephony_CallManager_setPausePicture_Promise_0500', 0, async function (done) { + let caseName = 'Telephony_CallManager_setPausePicture_Promise_0500'; + try { + let data = await scenceInCalling({ + caseName:caseName, + phoneNumber:AUTO_ACCEPT_NUMBER, + checkState:CALL_STATUS_DIALING }); + callId = data.callId; + } catch (error) { + console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); + done(); + return; + } + try { + await call.setPausePicture(IMAGE_LOCAL_ERROR_PATH); + console.log(`${caseName} success,case failed`); + } catch (error) { + console.log(`${caseName} case success,error:${toString(error)}`); + } + hangupCall2(caseName, done, callId); }); /** - * @tc.number Telephony_CallManager_isRinging_Async_0100 - * @tc.name Unwanted state ,run the function isRinging by callback ,the function return false + * @tc.number Telephony_CallManager_setDeviceDirection_Async_0500 + * @tc.name Dial a call and after answering the call,run function setDeviceDirection + * by args rotation ROTATION_MINUS_1 by callback,the callback function return error * @tc.desc Function test */ - it('Telephony_CallManager_isRinging_Async_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_isRinging_Async_0100'; - call.isRinging(function (error, data) { - if (error) { + it('Telephony_CallManager_setDeviceDirection_Async_0500', 0, function (done) { + let caseName = 'Telephony_CallManager_setDeviceDirection_Async_0500'; + scenceInCalling({ + caseName:caseName, + phoneNumber:AUTO_ACCEPT_NUMBER, + checkState:CALL_STATUS_DIALING + }).then(data => { + callId = data.callId; + call.setDeviceDirection(ROTATION_MINUS_1, (error) => { + if (error) { + console.log(`${caseName} success, case success`); + hangupCall2(caseName, done, callId); + return; + } console.log(`${caseName} error,case failed,error:${toString(error)}`); expect().assertFail(); - done(); - return; - } - console.log(`${caseName} success,case ${data === false ? 'success' : 'failed'},data:${toString(data)}`); - expect(data === false).assertTrue(); + hangupCall2(caseName, done, callId); + }); + }).catch(error => { + console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); done(); }); }); /** - * @tc.number Telephony_CallManager_isRinging_Promise_0100 - * @tc.name Unwanted state ,run the function isRinging by promise ,the function return false + * @tc.number Telephony_CallManager_setDeviceDirection_Promise_0500 + * @tc.name Dial a call and after answering the call,run function setDeviceDirection + * by args rotation ROTATION_MINUS_1 by promise,the callback function return error * @tc.desc Function test */ - it('Telephony_CallManager_isRinging_Promise_0100', 0, function (done) { - let caseName = 'Telephony_CallManager_isRinging_Promise_0100'; - call.isRinging() - .then(data => { - console.log(`${caseName} success,case ${data === false ? 'success' : 'failed'},data:${toString(data)}`); - expect(data === false).assertTrue(); - done(); - }) - .catch(error => { - console.log(`${caseName} error,case failed,error:${toString(error)}`); - expect().assertFail(); - done(); + it('Telephony_CallManager_setDeviceDirection_Promise_0500', 0, async function (done) { + let caseName = 'Telephony_CallManager_setDeviceDirection_Promise_0500'; + try { + let data = await scenceInCalling({ + caseName:caseName, + phoneNumber:AUTO_ACCEPT_NUMBER2, + checkState:CALL_STATUS_DIALING }); + callId = data.callId; + } catch (error) { + console.log(`${caseName} scenceInCalling error ,case failed,error:${toString(error)}`); + done(); + return; + } + try { + await call.setDeviceDirection(ROTATION_MINUS_1); + console.log(`${caseName} success,case error`); + expect().assertFail(); + } catch (error) { + console.log(`${caseName} case success,error:${toString(error)}`); + } + hangupCall2(caseName, done, callId); }); /** @@ -2058,120 +821,6 @@ describe('CallManageImsCall', function () { } }); - /** - * @tc.number Telephony_CallManager_getSubCallIdList_Async_0100 - * @tc.name If callId is 999, call getSubCallIdList() to get the call list of subcalls and return the empty list - * @tc.desc Function test - */ - it('Telephony_CallManager_getSubCallIdList_Async_0100', 0, async function (done) { - call.getSubCallIdList(CALL_ID_NOT_EXIST, (err, data) => { - if (err) { - expect().assertFail(); - console.log('Telephony_CallManager_getSubCallIdList_Async_0100 fail'); - done(); - return; - } - expect(data.length === 0).assertTrue(); - console.log(`Telephony_CallManager_getSubCallIdList_Async_0100 finish data = ${data}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_getSubCallIdList_Promise_0100 - * @tc.name If callId is 999, call getSubCallIdList() to get the sub-call list - * @tc.desc Function test - */ - it('Telephony_CallManager_getSubCallIdList_Promise_0100', 0, async function (done) { - try { - var data = await call.getSubCallIdList(CALL_ID_NOT_EXIST); - expect(data.length === 0).assertTrue(); - console.log(`Telephony_CallManager_getSubCallIdList_Promise_0100 finish data = ${data}`); - done(); - } catch (err) { - console.log('Telephony_CallManager_getSubCallIdList_Promise_0100 fail'); - expect().assertFail(); - done(); - - } - }); - - /** - * @tc.number Telephony_CallManager_getCallIdListForConference_Async_0100 - * @tc.name CallId for 999, the callback call getCallIdListForConference () to obtain a list all the phone call - * in the conference call, returns an empty list - * @tc.desc Function test - */ - it('Telephony_CallManager_getCallIdListForConference_Async_0100', 0, async function (done) { - call.getCallIdListForConference(CALL_ID_NOT_EXIST, (err, data) => { - if (err) { - console.log('Telephony_CallManager_getCallIdListForConference_Async_0100 fail'); - expect().assertFail(); - done(); - return; - } - expect(data.length === 0).assertTrue(); - console.log(`Telephony_CallManager_getCallIdListForConference_Async_0100 finish data = ${data}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_getCallIdListForConference_Promise_0100 - * @tc.name GetCallIdListForConference callId for 999, call () to obtain a list all the phone call in the - * conference call, returns an empty list - * @tc.desc Function test - */ - it('Telephony_CallManager_getCallIdListForConference_Promise_0100', 0, async function (done) { - try { - var data = await call.getCallIdListForConference(CALL_ID_NOT_EXIST); - expect(data.length === 0).assertTrue(); - console.log(`Telephony_CallManager_getCallIdListForConference_Promise_0100 finish data = ${data}`); - done(); - } catch (err) { - console.log('Telephony_CallManager_getCallIdListForConference_Promise_0100 fail'); - done(); - - } - }); - - /** - * @tc.number Telephony_CallManager_getMainCallId_Async_0100 - * @tc.name If the mainCallId is 999, call getMainCallId() to get the call and return -1 - * @tc.desc Function test - */ - it('Telephony_CallManager_getMainCallId_Async_0100', 0, async function (done) { - call.getMainCallId(CALL_ID_NOT_EXIST, (err, data) => { - if (err) { - expect().assertFail(); - console.log('Telephony_CallManager_getMainCallId_Async_0100 fail'); - done(); - return; - } - expect(data === GETMAIN_CALLID_ERRO).assertTrue(); - console.log(`Telephony_CallManager_getMainCallId_Async_0100 finish data = ${data}`); - done(); - }); - }); - - /** - * @tc.number Telephony_CallManager_getMainCallId_Promise_0100 - * @tc.name If mainCallId is 999, call getMainCallId() to get the call and return -1 - * @tc.desc Function test - */ - it('Telephony_CallManager_getMainCallId_Promise_0100', 0, async function (done) { - try { - var data = await call.getMainCallId(CALL_ID_NOT_EXIST); - expect(data === GETMAIN_CALLID_ERRO).assertTrue(); - console.log(`Telephony_CallManager_getMainCallId_Promise_0100 finish data = ${data}`); - done(); - } catch (err) { - expect().assertFail(); - console.log(`Telephony_CallManager_getMainCallId_Promise_0100 finish data = ${data}`); - done(); - } - }); - /** * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0100 * @tc.name PhoneNumber is 100000000000. Call formatPhoneNumber() to format the number. @@ -2293,157 +942,4 @@ describe('CallManageImsCall', function () { done(); } }); - - /** - * @tc.number Telephony_CallManager_isInEmergencyCall_Async_0200 - * @tc.name Dial an emergency number (THE_THREE_NUMBER) and call isInEmergencyCall() to determine whether - * an emergency call is made, returning true - * @tc.desc Function test - */ - it('Telephony_CallManager_isInEmergencyCall_Async_0200', 0, async function (done) { - const options = {accountId:SLOTID, videoState:MEDIA_TYPE_VOICE, dialScene:DIAL_SCENCE_CALL_PRIVILEGED, - dialType:DIAL_CARRIER_TYPE}; - call.dial(THE_THREE_NUMBER, options, async (err, data) => { - if (err) { - console.log(`Telephony_CallManager_isInEmergencyCall_Async_0200 dial fail : err = ${err}`); - done(); - return; - } - console.log(`Telephony_CallManager_isInEmergencyCall_Async_0200 dial finish : data = ${data}`); - const startTime = new Date().getTime(); - while (true) { - if (callState === call.CALL_STATUS_DIALING || callState === call.CALL_STATUS_ACTIVE || - callState === call.CALL_STATUS_ALERTING) { - call.isInEmergencyCall((err, data) => { - if (err) { - console.log( - `Telephony_CallManager_isInEmergencyCall_Async_0200 isInEmrgencyCall fail : err = ${ - err}` - ); - done(); - return; - } - console.log( - `Telephony_CallManager_isInEmergencyCall_Async_0200 isInEmrgencyCall finish : data = ${ - data}` - ); - done(); - - }); - return; - } - await sleep(WAITING_TIME); - endTime = new Date().getTime(); - timing = endTime - startTime; - if (timing > TIME_OUT) { - done(); - break; - } - } - }); - }); - - /** - * @tc.number Telephony_CallManager_isInEmergencyCall_Promise_0200 - * @tc.name Dial an emergency number (THE_THREE_NUMBER) and call isInEmergencyCall() to determine whether - * an emergency call is made. The return value is true - * @tc.desc Function test - */ - it('Telephony_CallManager_isInEmergencyCall_Promise_0200', 0, async function (done) { - try { - const options = {accountId:SLOTID, videoState:MEDIA_TYPE_VOICE, dialScene:DIAL_SCENCE_CALL_PRIVILEGED, - dialType:DIAL_CARRIER_TYPE}; - var data = await call.dial(THE_THREE_NUMBER, options); - console.log(`Telephony_CallManager_isInEmergencyCall_Promise_0200 dial finish : data = ${data}`); - const startTime = new Date().getTime(); - while (true) { - if (callState === call.CALL_STATUS_DIALING || callState === call.CALL_STATUS_ACTIVE || - callState === call.CALL_STATUS_ALERTING) { - try { - var data = await call.isInEmergencyCall(); - console.log(`Telephony_CallManager_isInEmergencyCall_Promise_0200 finish : data = ${data}`); - done(); - } catch (err) { - console.log(`Telephony_CallManager_isInEmergencyCall_Promise_0200 fail : err = ${err}`); - done(); - return; - } - return; - } - await sleep(WAITING_TIME); - endTime = new Date().getTime(); - timing = endTime - startTime; - if (timing > TIME_OUT) { - done(); - break; - } - } - } catch (err) { - console.log(`Telephony_CallManager_isInEmergencyCall_Promise_0200 dial fail : err = ${err}`); - done(); - } - }); - - /** - * @tc.number Telephony_CallManager_IMS_dial_Promise_0900 - * @tc.name Dial a call by function dial by args phoneNumber PHONE_NUMBER_LENGTH_11 options - * {accountId:DEFAULT_SLOT_ID, videoState:MEDIA_TYPE_VOICE, dialScene:DIAL_SCENCE_CALL_PRIVILEGED, - * dialType:DIAL_TYPE_ERR_CALL} by promise,the function return error - * @tc.desc Function test - */ - it('Telephony_CallManager_IMS_dial_Promise_0900', 0, function (done) { - let caseName = 'Telephony_CallManager_IMS_dial_Promise_0900'; - let flag = true; - reachState(caseName, CALL_STATUS_DIALING, '', false).then(data => { - callId = data.callId; - console.log(`${caseName} reachState success,case failed,data:${toString(data)}`); - hangupCall2(caseName, done, callId); - }).catch(error => { - console.log(`${caseName} reachState error,case ${flag ? 'success' : 'failed'},error:${toString(error)}`); - done(); - }); - let obj = {accountId:DEFAULT_SLOT_ID, videoState:MEDIA_TYPE_VOICE, - dialScene:DIAL_SCENCE_CALL_PRIVILEGED, dialType:DIAL_TYPE_ERR_CALL}; - call.dial(PHONE_NUMBER_LENGTH_11, obj).then(data => { - flag = false; - }).catch(error => { - console.log(`${caseName} dial error,error:${toString(error)}`); - flag = true; - }); - }); - - /** - * @tc.number Telephony_CallManager_on_0900 - * @tc.name Dial a call by number AUTO_ACCEPT_NUMBER options {accountId: DEFAULT_SLOT_ID, - * videoState: MEDIA_TYPE_VOICE,dialScene: DIAL_SCENCE_CALL_NORMAL, dialType:DIAL_TYPE_OTT} - * and before being accepted,the callEventChange event get EVENT_OTT_FUNCTION_UNSUPPORTED - * @tc.desc Function test - */ - it('Telephony_CallManager_on_0900', 0, function (done) { - let caseName = 'Telephony_CallManager_on_0900'; - let callId = null; - reachCallEventState(EVENT_OTT_FUNCTION_UNSUPPORTED).then(data => { - console.log(`${caseName} reachCallEventState success,case ${ - data.eventId === EVENT_OTT_FUNCTION_UNSUPPORTED ? - 'success' : 'failed'},data:${toString(data)}`); - done(); - }).catch(error => { - if (callId) { - console.log(`${caseName} reachCallEventState error,case failed,error:${toString(error)}`); - done(); - } else { - console.log(`${caseName} scenceInCalling error,case failed,error:${toString(error)}`); - done(); - } - }); - let options = {accountId: DEFAULT_SLOT_ID, videoState: MEDIA_TYPE_VOICE, - dialScene: DIAL_SCENCE_CALL_NORMAL, dialType:DIAL_TYPE_OTT}; - call.dial(AUTO_ACCEPT_NUMBER, options, (err, data) => { - if (err) { - console.log(`${caseName} dial err:${err}`); - return; - } - console.log(`${caseName} dial success data:${data}`); - }); - }); }); \ No newline at end of file diff --git a/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/entry/src/main/config.json b/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/entry/src/main/config.json index d4661f1ec22b3485dd6e5825d19e3d8579a7a2b8..3689150af7e819b9ac325d2158c5268cfc438512 100644 --- a/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/entry/src/main/config.json +++ b/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/entry/src/main/config.json @@ -45,7 +45,7 @@ "launchType": "standard" } ], - "reqPermissions": [ + "reqPermissions": [ { "name": "ohos.permission.LOCATION", "reason": "need use ohos.permission.LOCATION" diff --git a/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/entry/src/main/js/test/CellularDataAbnorma.test.js b/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/entry/src/main/js/test/CellularDataAbnorma.test.js index ff9e708de1dde69cea7df08ded4c334fc0cb0ac8..33f2b52461b6268ba2688d41e1a7b3d4562a5f7c 100644 --- a/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/entry/src/main/js/test/CellularDataAbnorma.test.js +++ b/telephony/telephonyjstest/cellular_data/cellular_data_abnormal/entry/src/main/js/test/CellularDataAbnorma.test.js @@ -56,83 +56,7 @@ describe("ActsCellularDataAbnormalTest", function () { done(); }) }) - - /* - * @tc.number Telephony_CellularData_enableCellularData_Async_0100 - * @tc.name Open the data switch and query the switch status and data status - * @tc.desc Function test - */ - it("Telephony_CellularData_enableCellularData_Async_0100", 0, async function (done) { - cellular.enableCellularData((err) => { - if (err) { - console.log("Telephony_CellularData_enableCellularData_Async_0100 enableCellularData finish"); - done(); - return; - } - expect().assertFail(); - console.log("Telephony_CellularData_enableCellularData_Async_0100 enableCellularData fail"); - done(); - }) - }) - - /* - * @tc.number Telephony_CellularData_disableCellularData_Async_0100 - * @tc.name Turn off the data switch and query the switch status and data status - * @tc.desc Function test - */ - it("Telephony_CellularData_disableCellularData_Async_0100", 0, async function (done) { - cellular.disableCellularData((err) => { - if (err) { - console.log("Telephony_CellularData_disableCellularData_Async_0100 disableCellularData finish"); - done(); - return; - } - expect().assertFail(); - console.log("Telephony_CellularData_disableCellularData_Async_0100 disableCellularData fail"); - done(); - }) - }) - - /* - * @tc.number Telephony_CellularData_enableCellularDataRoaming_Async_0300 - * @tc.name Call enableCellularDataRoaming interface, setting parameters as slotId error value (3), - * to check the correction results - * @tc.desc Function test - */ - it("Telephony_CellularData_enableCellularDataRoaming_Async_0300", 0, async function (done) { - cellular.enableCellularDataRoaming(ERR_SLOT_ID, (err) => { - if (err) { - console.log("Telephony_CellularData_enableCellularDataRoaming_Async_0300 enableCellularData finish"); - done(); - return; - } - expect().assertFail(); - console.log("Telephony_CellularData_enableCellularDataRoaming_Async_0300 enableCellularData fail"); - done(); - }) - }) - - /* - * @tc.number Telephony_CellularData_disableCellularDataRoaming_Async_0300 - * @tc.name Call enableCellularDataRoaming interface, setting parameters as slotId error value (3), to check the - * correction results - * @tc.desc Function test - */ - it("Telephony_CellularData_disableCellularDataRoaming_Async_0300", 0, async function (done) { - cellular.disableCellularDataRoaming(ERR_SLOT_ID, (err) => { - if (err) { - console.log( - "Telephony_CellularData_disableCellularDataRoaming_Async_0300 disableCellularDataRoaming finish" - ); - done(); - return; - } - expect().assertFail(); - console.log("Telephony_CellularData_disableCellularDataRoaming_Async_0300 disableCellularDataRoaming fail"); - done(); - }) - }) - + /* * @tc.number Telephony_CellularData_getCellularDataFlowType_Async_0100 * @tc.name When cellular data is turned on, call getCellularDataFlowType() to get the data stream type and @@ -170,26 +94,7 @@ describe("ActsCellularDataAbnormalTest", function () { done(); }) }) - - /* - * @tc.number Telephony_CellularData_setDefaultCellularDataSlotId_Async_0500 - * @tc.name Call setDefaultCellularDataSlotId() interface, set the default card slot to the number of exceptions - * (-1), and verify whether the setting failed (Async) - * @tc.desc Function test - */ - it("Telephony_CellularData_setDefaultCellularDataSlotId_Async_0500", 0, async function (done) { - cellular.setDefaultCellularDataSlotId(ERR_SLOT_ID, (err) => { - if (err) { - console.log("Telephony_CellularData_setDefaultCellularDataSlotId_Async_0500 finish"); - done(); - return; - } - expect().assertFail(); - console.log("Telephony_CellularData_setDefaultCellularDataSlotId_Async_0500 fail"); - done(); - }) - }) - + /* * @tc.number Telephony_CellularData_getDefaultCellularDataSlotId_Async_0500 * @tc.name Call getDefaultCellularDataSlotId() interface and verify whether the setting failed (Async) @@ -244,76 +149,6 @@ describe("ActsCellularDataAbnormalTest", function () { } }) - /* - * @tc.number Telephony_CellularData_enableCellularData_Promise_0100 - * @tc.name Open the data switch and query the switch status and data status - * @tc.desc Function test - */ - it("Telephony_CellularData_enableCellularData_Promise_0100", 0, async function (done) { - try { - await cellular.enableCellularData(); - expect().assertFail(); - console.log("Telephony_CellularData_enableCellularData_Promise_0100 fail"); - done(); - } catch (err) { - console.log("Telephony_CellularData_enableCellularData_Promise_0100 finish"); - done(); - } - }) - - /* - * @tc.number Telephony_CellularData_disableCellularData_Promise_0100 - * @tc.name Turn off the data switch and query the switch status and data status - * @tc.desc Function test - */ - it("Telephony_CellularData_disableCellularData_Promise_0100", 0, async function (done) { - try { - await cellular.disableCellularData(); - expect().assertFail(); - console.log("Telephony_CellularData_disableCellularData_Promise_0100 fail"); - done(); - } catch (err) { - console.log("Telephony_CellularData_disableCellularData_Promise_0100 finish"); - done(); - } - }) - - /* - * @tc.number Telephony_CellularData_enableCellularDataRoaming_Promise_0300 - * @tc.name Call enableCellularDataRoaming interface, setting parameters as slotId error value (3), - * to check the correction results - * @tc.desc Function test - */ - it("Telephony_CellularData_enableCellularDataRoaming_Promise_0300", 0, async function (done) { - try { - await cellular.enableCellularDataRoaming(ERR_SLOT_ID); - expect().assertFail(); - console.log("Telephony_CellularData_enableCellularDataRoaming_Promise_0300 fail"); - done(); - } catch (err) { - console.log("Telephony_CellularData_enableCellularDataRoaming_Promise_0300 finish"); - done(); - } - }) - - /* - * @tc.number Telephony_CellularData_disableCellularDataRoaming_Promise_0300 - * @tc.name Call enableCellularDataRoaming interface, setting parameters as slotId error value (3), to check the - * correction results - * @tc.desc Function test - */ - it("Telephony_CellularData_disableCellularDataRoaming_Promise_0300", 0, async function (done) { - try { - await cellular.disableCellularDataRoaming(ERR_SLOT_ID); - expect().assertFail(); - console.log("Telephony_CellularData_disableCellularDataRoaming_Promise_0300 fail"); - done(); - } catch (err) { - console.log("Telephony_CellularData_disableCellularDataRoaming_Promise_0300 finish"); - done(); - } - }) - /* * @tc.number Telephony_CellularData_getCellularDataFlowType_Promise_0100 * @tc.name When cellular data is turned on, call getCellularDataFlowType() to get the data stream type and @@ -350,24 +185,6 @@ describe("ActsCellularDataAbnormalTest", function () { } }) - /* - * @tc.number Telephony_CellularData_setDefaultCellularDataSlotId_Promise_0500 - * @tc.name Call setDefaultCellularDataSlotId() interface, set the default card slot to the number of exceptions - * (-1), and verify whether the setting failed (Async) - * @tc.desc Function test - */ - it("Telephony_CellularData_setDefaultCellularDataSlotId_Promise_0500", 0, async function (done) { - try { - await cellular.setDefaultCellularDataSlotId(ERR_SLOT_ID); - expect().assertFail(); - console.log("Telephony_CellularData_setDefaultCellularDataSlotId_Promise_0500 fail"); - done(); - } catch (err) { - console.log("Telephony_CellularData_setDefaultCellularDataSlotId_Promise_0500 finish"); - done(); - } - }) - /* * @tc.number Telephony_CellularData_getDefaultCellularDataSlotId_Promise_0500 * @tc.name Call getDefaultCellularDataSlotId() interface and verify whether the setting failed (Async) diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/config.json b/telephony/telephonyjstest/netmanager_http/entry/src/main/config.json index 09ccedf9771387691d28d06eba86935a6a887679..295ac996e7daf3a571f51fbd416d04c9b72fe206 100644 --- a/telephony/telephonyjstest/netmanager_http/entry/src/main/config.json +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/config.json @@ -52,7 +52,7 @@ "launchType": "standard" } ], - "reqPermissions": [ + "reqPermissions": [ { "name": "ohos.permission.LOCATION", "reason": "need use ohos.permission.LOCATION" diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestJsunit.test.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestJsunit.test.ets index 3dcab425b76e949b068fdd295cfd2c0438a354cb..9206a966e37720ada0a50ca7a614451365d48e2e 100644 --- a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestJsunit.test.ets +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestJsunit.test.ets @@ -116,13 +116,11 @@ export default function httpRequestJsunit() { } }); - /** * @tc.number Telephony_http_HttpRequest_destroy_0100 * @tc.name httprequest::destroy * @tc.desc Test Test httprequest property. */ - it("Telephony_http_HttpRequest_destroy_0100", 0, async function (done) { var casename = "Telephony_http_HttpRequest_0200" console.log("-----------------------HttpRequest_destroy Test is starting-----------------------"); @@ -163,7 +161,6 @@ export default function httpRequestJsunit() { * @tc.name httprequest::on_headerReceive * @tc.desc Test Test httprequest property. */ - it("Telephony_http_HttpRequest_on_headerReceive_0100", 0, async function (done) { var casename = "Telephony_http_HttpRequest_0300" console.log("-----------------------HttpRequest_on_headerReceive Test is starting-----------------------"); diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestOptionsJsunit.test.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestOptionsJsunit.test.ets index 7d711790c160bfb286d3599966346be766881731..66c3449c0f8598fce7c7475831c23ec440c4f1f4 100644 --- a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestOptionsJsunit.test.ets +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestOptionsJsunit.test.ets @@ -55,8 +55,6 @@ export default function HttpRequestOptionsJsunit() { } }); - - /** * @tc.number Telephony_http_HttpRequestOptions_method_0200 * @tc.name HttpRequestOptions::method @@ -94,7 +92,6 @@ export default function HttpRequestOptionsJsunit() { } }); - /** * @tc.number Telephony_Http_HttpRequestOptions_extraData_0100 * @tc.name HttpRequestOptions::extraData @@ -137,8 +134,6 @@ export default function HttpRequestOptionsJsunit() { } }); - - /** * @tc.number Telephony_Http_HttpRequestOptions_extraData_0200 * @tc.name HttpRequestOptions::extraData @@ -184,13 +179,11 @@ export default function HttpRequestOptionsJsunit() { } }); - /** * @tc.number Telephony_Http_HttpRequestOptions_header_0100 * @tc.name HttpRequestOptions::header * @tc.desc Test Test HttpRequestOptions property. */ - it("Telephony_Http_HttpRequestOptions_header_0100", 0, async function (done) { var casename = 'Telephony_Http_HttpRequestOptions_0300'; console.log("-----------------------HttpRequestOptions_header Test is starting-----------------------"); @@ -232,7 +225,6 @@ export default function HttpRequestOptionsJsunit() { * @tc.name HttpRequestOptions::header * @tc.desc Test Test HttpRequestOptions property. */ - it("Telephony_Http_HttpRequestOptions_header_0200", 0, async function (done) { var casename = 'Telephony_Http_HttpRequestOptions_0300'; console.log("-----------------------HttpRequestOptions_header_01 Test is starting-----------------------"); @@ -281,7 +273,6 @@ export default function HttpRequestOptionsJsunit() { * @tc.name HttpRequestOptions::header * @tc.desc Test Test HttpRequestOptions property. */ - it("Telephony_Http_HttpRequestOptions_header_0300", 0, async function (done) { var casename = 'Telephony_Http_HttpRequestOptions_0300'; console.log("-----------------------HttpRequestOptions_header_02 Test is starting-----------------------"); @@ -323,7 +314,6 @@ export default function HttpRequestOptionsJsunit() { * @tc.name HttpRequestOptions::header * @tc.desc Test Test HttpRequestOptions property. */ - it("Telephony_Http_HttpRequestOptions_header_0400", 0, async function (done) { var casename = 'Telephony_Http_HttpRequestOptions_0300'; console.log("-----------------------HttpRequestOptions_header_03 Test is starting-----------------------"); @@ -364,10 +354,6 @@ export default function HttpRequestOptionsJsunit() { } }); - - - - /** * @tc.number Telephony_Http_HttpRequestOptions_readTimeout_0100 * @tc.name HttpRequestOptions::readTimeout @@ -408,7 +394,6 @@ export default function HttpRequestOptionsJsunit() { * @tc.name HttpRequestOptions::readTimeout * @tc.desc Test Test HttpRequestOptions property. */ - it("Telephony_Http_HttpRequestOptions_readTimeout_0200", 0, async function (done) { var casename = 'Telephony_Http_HttpRequestOptions_0400'; console.log("-----------------------HttpRequestOptions_readTimeout_01 Test is starting-----------------------"); @@ -441,13 +426,11 @@ export default function HttpRequestOptionsJsunit() { } }); - /** * @tc.number Telephony_Http_HttpRequestOptions_connectTimeout_0100 * @tc.name HttpRequestOptions::connectTimeout * @tc.desc Test Test HttpRequestOptions property. */ - it("Telephony_Http_HttpRequestOptions_connectTimeout_0100", 0, async function (done) { var casename = 'Telephony_Http_HttpRequestOptions_0500'; console.log("-----------------------HttpRequestOptions_connectTimeout Test is starting-----------------------"); @@ -483,7 +466,6 @@ export default function HttpRequestOptionsJsunit() { * @tc.name HttpRequestOptions::connectTimeout * @tc.desc Test Test HttpRequestOptions property. */ - it("Telephony_Http_HttpRequestOptions_connectTimeout_0200", 0, async function (done) { var casename = 'Telephony_Http_HttpRequestOptions_0500'; console.log("-----------------------HttpRequestOptions_connectTimeout_01 Test is starting-----------------------"); diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpResponseJsunit.test.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpResponseJsunit.test.ets index 215913b1f3b8f1797c37aa3a985b38d5f80b09df..2b00a5d0104311da3800d3c2c4d8676e9b12baca 100644 --- a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpResponseJsunit.test.ets +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpResponseJsunit.test.ets @@ -331,16 +331,12 @@ export default function httpResponseJsunit() { } }); - - - /** * @tc.number Telephony_Http_HttpResponse_cookies_0100 * @tc.name HttpResponse::cookies * @tc.desc Test Test HttpResponse property. */ - it("Telephony_Http_HttpResponse_cookies_0100", 0, async function (done) { var casename = 'Telephony_Http_HttpResponse_0400'; console.log("-----------------------HttpResponse cookies Test is starting-----------------------"); @@ -378,7 +374,6 @@ export default function httpResponseJsunit() { * @tc.desc Test Test HttpResponse property. */ - it("Telephony_Http_HttpResponse_cookies_0200", 0, async function (done) { var casename = 'Telephony_Http_HttpResponse_0400'; console.log("-----------------------HttpResponse cookies_01 Test is starting-----------------------"); @@ -402,15 +397,12 @@ export default function httpResponseJsunit() { }); - - /** * @tc.number Telephony_Http_HttpResponse_cookies_0300 * @tc.name HttpResponse::cookies * @tc.desc Test Test HttpResponse property. */ - it("Telephony_Http_HttpResponse_cookies_0300", 0, async function (done) { var casename = 'Telephony_Http_HttpResponse_0400'; console.log("-----------------------HttpResponse cookies_02 Test is starting-----------------------"); diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/RequestMethodJsunit.test.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/RequestMethodJsunit.test.ets index eb3cc28a97c5e9942f5618bf2f84bb5888be0344..62afeb9ce4824c1270d9552044422d4f03473eea 100644 --- a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/RequestMethodJsunit.test.ets +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/RequestMethodJsunit.test.ets @@ -417,11 +417,6 @@ export default function requestMethodJsunit() { } }); - - - - - }) }; diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/ResponseCodeJsunit.test.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/ResponseCodeJsunit.test.ets index 473614c51651ab05d7cc25fbe78570253e828361..7b642b0e7f760e18063843215dafaf5eb7cdfbe7 100644 --- a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/ResponseCodeJsunit.test.ets +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/ResponseCodeJsunit.test.ets @@ -544,7 +544,6 @@ export default function responseCodeJsunit() { }); - /** * @tc.number Telephony_Http_ResponseCode_CONFLICT_0100 * @tc.name ResponseCode::CONFLICT @@ -564,8 +563,6 @@ export default function responseCodeJsunit() { }); - - /** * @tc.number Telephony_Http_ResponseCode_GONE_0100 * @tc.name ResponseCode::GONE diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/config.json b/telephony/telephonyjstest/netmanager_socket/entry/src/main/config.json index cc9d1734fcf208d3e853eb64208678d22b74e98b..52694233d1df26520de72eeae862ee3d4d2f8d62 100644 --- a/telephony/telephonyjstest/netmanager_socket/entry/src/main/config.json +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/config.json @@ -52,7 +52,7 @@ "launchType": "standard" } ], - "reqPermissions": [ + "reqPermissions": [ { "name": "ohos.permission.LOCATION", "reason": "need use ohos.permission.LOCATION" diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionJsunit.test.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionJsunit.test.ets index 9c050ddb9282a91e1f0b5a41381e87dd542f7a00..8d372ec9136a49178c8d27ad2a3a898e7d89896a 100644 --- a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionJsunit.test.ets +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionJsunit.test.ets @@ -407,80 +407,6 @@ export default function connectionJsunit() { done(); }); - - /* - * @tc.number : Telephony_Connection_Connection_enableAirplaneMode_0100 - * @tc.name : enableAirplaneMode - * @tc.desc : Enables the airplane mode for a device. - */ - it('Telephony_Connection_Connection_enableAirplaneMode_0100', 0, function (done) { - console.log("************* Telephony_Connection_Connection_enableAirplaneMode_0100 Test start*************"); - connection.enableAirplaneMode((error, data) => { - if (error) { - expect(true).assertTrue(); - done(); - return; - } - expect().assertFail(); - done(); - }); - console.log("************* Telephony_Connection_Connection_enableAirplaneMode_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : Telephony_Connection_Connection_enableAirplaneMode_0200 - * @tc.name : enableAirplaneMode - * @tc.desc : Enables the airplane mode for a device. - */ - it('Telephony_Connection_Connection_enableAirplaneMode_0200', 0, function (done) { - console.log("************* Telephony_Connection_Connection_enableAirplaneMode_0200 Test start*************"); - connection.enableAirplaneMode().then(data => { - expect(true).assertTrue(); - }).catch(err => { - expect().assertFail(); - }); - console.log("************* Telephony_Connection_Connection_enableAirplaneMode_0200 Test end*************"); - done(); - }); - - /* - * @tc.number : Telephony_Connection_Connection_disableAirplaneMode_0100 - * @tc.name : disableAirplaneMode - * @tc.desc : Disables the airplane mode for a device. - */ - it('Telephony_Connection_Connection_disableAirplaneMode_0100', 0, function (done) { - console.log("************* Telephony_Connection_Connection_disableAirplaneMode_0100 Test start*************"); - connection.disableAirplaneMode((error, data) => { - if (error) { - expect(true).assertTrue(); - done(); - return; - } - expect().assertFail(); - done(); - }); - console.log("************* Telephony_Connection_Connection_disableAirplaneMode_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : Telephony_Connection_Connection_disableAirplaneMode_0200 - * @tc.name : disableAirplaneMode - * @tc.desc : Disables the airplane mode for a device. - */ - it('Telephony_Connection_Connection_disableAirplaneMode_0200', 0, function (done) { - console.log("************* Telephony_Connection_Connection_reportNetConnected_0200 Test start*************"); - connection.disableAirplaneMode().then(data => { - expect(true).assertTrue(); - }).catch(err => { - expect().assertFail(); - }); - console.log("************* Telephony_Connection_Connection_disableAirplaneMode_0200 Test end*************"); - done(); - }); - - /* * @tc.number : Telephony_Connection_Connection_reportNetConnected_0100 * @tc.name : reportNetConnected diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/List.test.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/List.test.ets index 410c1e4b7cb1bfecd2ff9bd20f5b87206f547b12..eed2cac75eddbcd64829b41b76be646eb592e0f3 100644 --- a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/List.test.ets +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/List.test.ets @@ -16,13 +16,13 @@ //other import import connectionJsunit from './ConnectionJsunit.test.ets'; import socketJsunit from './SocketJsunit.test.ets'; -//import webSocketJsunit from './WebSocketJsunit.test.ets'; +import webSocketJsunit from './WebSocketJsunit.test.ets'; import connectionSecondJsUnit from './ConnectionSecondJsUnit.test.ets'; export default function testsuite() { //other socketJsunit(); - //webSocketJsunit(); + webSocketJsunit(); connectionJsunit(); connectionSecondJsUnit(); } \ No newline at end of file diff --git a/telephony/telephonyjstest/network_search/network_search_errors/entry/src/main/config.json b/telephony/telephonyjstest/network_search/network_search_errors/entry/src/main/config.json index b22e9627bc18faa7b0a54fab971d056cd285645d..113a434baa0a19961d49692fdd823e18730a8c26 100644 --- a/telephony/telephonyjstest/network_search/network_search_errors/entry/src/main/config.json +++ b/telephony/telephonyjstest/network_search/network_search_errors/entry/src/main/config.json @@ -45,7 +45,7 @@ "launchType": "standard" } ], - "reqPermissions": [ + "reqPermissions": [ { "name": "ohos.permission.LOCATION", "reason": "need use ohos.permission.LOCATION" 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 a4a24a43e44a4a6661ec7ae01e76175d69c2a2fc..acb46b815cdac3d875c7261c1994f19e45532261 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 @@ -240,105 +240,9 @@ describe('ActsNetworkSearchTest', function () { done(); }); - /** - * @tc.number Telephony_NetworkSearch_setNetworkSelectionMode_Async_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) { - - let networkSMode = { - slotId: 55, //set the error slot id is 55 - selectMode: radio.NETWORK_SELECTION_AUTOMATIC, - networkInformation: { - operatorName: '', - operatorNumeric: '', - state: radio.NETWORK_AVAILABLE, - radioTech: radio.RADIO_TECHNOLOGY_GSM.toString(), - }, - resumeSelection: false, - }; - console.log( - `Telephony_NetworkSearch_setNetworkSelectionMode_Async_0700 networkSMode:${JSON.stringify(networkSMode)}`) - radio.setNetworkSelectionMode(networkSMode, (err) => { - if (err) { - console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Async_0700 set finish'); - done(); - return; - } - console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Async_0700 set not go to err'); - expect().assertFail(); - done(); - }); - }); - - /** - * @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_Promise_0700', 0, async function (done) { - let networkSMode = { - slotId: 55, //set the error slot id is 55 - selectMode: radio.NETWORK_SELECTION_AUTOMATIC, - networkInformation: { - operatorName: '', - operatorNumeric: '', - state: radio.NETWORK_AVAILABLE, - radioTech: radio.RADIO_TECHNOLOGY_GSM.toString(), - }, - resumeSelection: false, - }; - console.log( - `Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0700 networkSMode:${JSON.stringify(networkSMode)}`) - try { - await radio.setNetworkSelectionMode(networkSMode); - console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0200 set fail'); - expect().assertFail(); - done(); - } catch (err) { - console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0200 set finish'); - done(); - }; - }); - - /** - * @tc.number Telephony_NetworkSearch_getNetworkSearchInformation_Async_0400 - * @tc.name SlotId parameter input is -1, test getNetworkSearchInformation() query function go to the error - * @tc.desc Function test - */ - 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 { - console.log('Telephony_NetworkSearch_getNetworkSearchInformation_Async_0400 fail not go to err'); - expect().assertFail(); - } - }); - done(); - }); + - /** - * @tc.number Telephony_NetworkSearch_getNetworkSearchInformation_Promise_0400 - * @tc.name SlotId parameter input is -1, test getNetworkSearchInformation() query function go to the error - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_getNetworkSearchInformation_Promise_0400', 0, async function (done) { - try { - await radio.getNetworkSearchInformation(SLOT_2); - console.log('Telephony_NetworkSearch_getNetworkSearchInformation_Promise_0400 fail not go to err'); - expect().assertFail(); - done(); - return; - } catch (err) { - console.log(`Telephony_NetworkSearch_getNetworkSearchInformation_Promise_0400 finish err: ${err}`); - } - done(); - }); + /** * @tc.number Telephony_NetworkSearch_getNetworkState_Promise_0700 @@ -433,391 +337,7 @@ describe('ActsNetworkSearchTest', function () { } }) - /** - * @tc.number Telephony_NetworkSearch_getPreferredNetwork_Async_0700 - * @tc.name Verify the abnormal input of "slotId", test getPreferredNetwork() to view the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_getPreferredNetwork_Async_0700', 0, async function (done) { - radio.getPreferredNetwork(SLOT_2, (err, data) => { - if (err) { - console.log(`Telephony_NetworkSearch_getPreferredNetwork_Async_0700 get PASS err: ${err}`); - done(); - return; - } - console.log(`Telephony_NetworkSearch_getPreferredNetwork_Async_0700 fail not into err data: ${data}`); - expect().assertFail(); - done(); - }) - }) - - /** - * @tc.number Telephony_NetworkSearch_getPreferredNetwork_Promise_0700 - * @tc.name Verify the abnormal input of "slotId", test getPreferredNetwork() to view the return result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_getPreferredNetwork_Promise_0700', 0, async function (done) { - try { - let data = await radio.getPreferredNetwork(SLOT_2); - console.log(`Telephony_NetworkSearch_getPreferredNetwork_Promise_0700 fail data: ${data}`); - expect().assertFail(); - done(); - return; - } catch (err) { - console.log(`Telephony_NetworkSearch_getPreferredNetwork_Promise_0700 finish err: ${err}`); - done(); - } - }) - - /** - * @tc.number Telephony_NetworkSearch_setPreferredNetwork_Async_0100 - * @tc.name Verify the abnormal input of "preferredNetworkMode", - * test setPreferredNetwork() to view the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_setPreferredNetwork_Async_0100', 0, async function (done) { - radio.setPreferredNetwork(SLOT_0, PREFERRED_MODE_ERR2, (err, data) => { - if (err) { - console.log(`Telephony_NetworkSearch_setPreferredNetwork_Async_0100 set err: ${err}`); - radio.getPreferredNetwork(SLOT_0, (err, data) => { - if (err) { - console.log(`Telephony_NetworkSearch_setPreferredNetwork_Async_0100 get fail err: ${err}`); - done(); - return; - } - console.log(`Telephony_NetworkSearch_setPreferredNetwork_Async_0100 finish data: ${data}`); - expect(data === radio.PREFERRED_NETWORK_MODE_AUTO).assertTrue(); - done(); - }) - } else { - console.log(`Telephony_NetworkSearch_setPreferredNetwork_Async_0100 fail err: ${data}`); - expect().assertFail(); - done(); - } - }); - }); - - /** - * @tc.number Telephony_NetworkSearch_setPreferredNetwork_Async_0600 - * @tc.name Verify the "slotId" abnormal input, test setPreferredNetwork() to view the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_setPreferredNetwork_Async_0600', 0, async function (done) { - radio.setPreferredNetwork(SLOT_2, radio.PREFERRED_NETWORK_MODE_GSM, (err, data) => { - if (err) { - console.log(`Telephony_NetworkSearch_setPreferredNetwork_Async_0600 finish err: ${err}`); - radio.getPreferredNetwork(SLOT_0, (err, data) => { - if (err) { - console.log(`Telephony_NetworkSearch_setPreferredNetwork_Async_0600 get fail err: ${err}`); - done(); - return; - } - console.log( - `Telephony_NetworkSearch_setPreferredNetwork_Async_0600 finish data: ${JSON.stringify(data)}`); - expect(data === radio.PREFERRED_NETWORK_MODE_AUTO).assertTrue(); - done(); - }) - } else { - console.log(`Telephony_NetworkSearch_setPreferredNetwork_Async_0600 fail: not go to err ${data}`); - expect().assertFail(); - done(); - } - }); - }); - - /** - * @tc.number Telephony_NetworkSearch_setPreferredNetwork_Promise_0100 - * @tc.name Verify the abnormal input of "preferredNetworkMode", - * test setPreferredNetwork() to view the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_setPreferredNetwork_Promise_0100', 0, async function (done) { - try { - await radio.setPreferredNetwork(SLOT_0, PREFERRED_MODE_ERR2); - console.log('Telephony_NetworkSearch_setPreferredNetwork_Promise_0100 set fail: not go to err'); - expect().assertFail(); - done(); - } catch (err) { - try { - let data = await radio.getPreferredNetwork(SLOT_0); - console.log(`Telephony_NetworkSearch_setPreferredNetwork_Promise_0100 finish data: ${data}`); - expect(data === radio.PREFERRED_NETWORK_MODE_AUTO).assertTrue(); - done(); - } catch (err) { - console.log(`Telephony_NetworkSearch_setPreferredNetwork_Promise_0100 fail err: ${err}`); - done(); - } - } - }); - - /** - * @tc.number Telephony_NetworkSearch_setPreferredNetwork_Promise_0600 - * @tc.name Verify the abnormal input of "slotId", test setPreferredNetwork() return result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_setPreferredNetwork_Promise_0600', 0, async function (done) { - try { - await radio.setPreferredNetwork(SLOT_2, radio.PREFERRED_NETWORK_MODE_GSM); - console.log('Telephony_NetworkSearch_setPreferredNetwork_Promise_0600 set fail: not go to err'); - expect().assertFail(); - done(); - } catch (err) { - try { - let data = await radio.getPreferredNetwork(SLOT_0); - console.log(`Telephony_NetworkSearch_setPreferredNetwork_Promise_0600 finish data: ${data}`); - expect(data === radio.PREFERRED_NETWORK_MODE_AUTO).assertTrue(); - done(); - } catch (err) { - console.log(`Telephony_NetworkSearch_setPreferredNetwork_Promise_0600 fail err: ${err}`); - done(); - } - } - }); - - /** - * @tc.number Telephony_NetworkSearch_getCellInformation_Async_0500 - * @tc.name Test getCellInformation() with anomalous soltId(-1) to view the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_getCellInformation_Async_0500', 0, async function (done) { - radio.getCellInformation(SLOT_2, (err, data) => { - if (err) { - console.log(`Telephony_NetworkSearch_getCellInformation_Async_0500 fail: ${err}`); - expect().assertFail(); - done(); - return; - } - console.log(`Telephony_NetworkSearch_getCellInformation_Async_0500 end data: ${JSON.stringify(data)}`); - expect(data !== '' && data != undefined && data != null).assertTrue(); - expect(data.length).assertEqual(0); - done(); - }); - }); - - /** - * @tc.number Telephony_NetworkSearch_getCellInformation_Promise_0500 - * @tc.name Test getCellInformation() with anomalous soltId(-1) to view the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_getCellInformation_Promise_0500', 0, async function (done) { - radio.getCellInformation(SLOT_2).then(data => { - console.log(`Telephony_NetworkSearch_getCellInformation_Promise_0500 end data: ${JSON.stringify(data)}`); - expect(data !== '' && data != undefined && data != null).assertTrue(); - expect(data.length).assertEqual(0); - done(); - }).catch(err => { - console.log(`Telephony_NetworkSearch_getCellInformation_Promise_0500 fail: ${err}`); - expect().assertFail(); - done(); - }) - }); - - /** - * @tc.number Telephony_NetworkSearch_sendUpdateCellLocationRequest_Async_0100 - * @tc.name Test sendUpdateCellLocationRequest() to view the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_sendUpdateCellLocationRequest_Async_0100', 0, async function (done) { - radio.sendUpdateCellLocationRequest((err) => { - if (err) { - console.log(`Telephony_NetworkSearch_sendUpdateCellLocationRequest_Async_0100 fail: ${err}`); - done(); - return; - } - console.log(`Telephony_NetworkSearch_sendUpdateCellLocationRequest_Async_0100 success`) - done(); - }); - }); - - /** - * @tc.number Telephony_NetworkSearch_sendUpdateCellLocationRequest_Promise_0100 - * @tc.name Test sendUpdateCellLocationRequest() to view the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_sendUpdateCellLocationRequest_Promise_0100', 0, async function (done) { - radio.sendUpdateCellLocationRequest().then(data => { - console.log(`Telephony_NetworkSearch_sendUpdateCellLocationRequest_Promise_0100 end data: ${data}`); - done(); - }).catch(err => { - console.log(`Telephony_NetworkSearch_sendUpdateCellLocationRequest_Promise_0100 fail: ${err}`); - done(); - }) - }); - - /** - * @tc.number Telephony_NetworkSearch_getIMEI_Async_0500 - * @tc.name Test getIMEI(-1) to check the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_getIMEI_Async_0500', 0, async function (done) { - radio.getIMEI(SLOT_2, (err, data) => { - if (err) { - console.log(`Telephony_NetworkSearch_getIMEI_Async_0500 fail: ${err}`); - expect().assertFail(); - done(); - return; - } - console.log(`Telephony_NetworkSearch_getIMEI_Async_0500 end data: ${data}`); - expect(data === '').assertTrue(); - done(); - }); - }); - - /** - * @tc.number Telephony_NetworkSearch_getIMEI_Promise_0500 - * @tc.name Test getIMEI(-1) to check the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_getIMEI_Promise_0500', 0, async function (done) { - radio.getIMEI(SLOT_2).then(data => { - console.log(`Telephony_NetworkSearch_getIMEI_Promise_0500 end data: ${data}`); - expect(data === '').assertTrue(); - done(); - }).catch(err => { - console.log(`Telephony_NetworkSearch_getIMEI_Promise_0500 fail: ${err}`); - expect().assertFail(); - done(); - }) - }); - - /** - * @tc.number Telephony_NetworkSearch_getUniqueDeviceId_Async_0500 - * @tc.name Test getUniqueDeviceId(-1) to check the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_getUniqueDeviceId_Async_0500', 0, async function (done) { - radio.getUniqueDeviceId(SLOT_2, (err, data) => { - if (err) { - console.log(`Telephony_NetworkSearch_getUniqueDeviceId_Async_0500 fail: ${err}`); - expect().assertFail(); - done(); - return; - } - console.log(`Telephony_NetworkSearch_getUniqueDeviceId_Async_0500 end data: ${data}`); - expect(data === '').assertTrue(); - done(); - }); - }); - - /** - * @tc.number Telephony_NetworkSearch_getUniqueDeviceId_Promise_0500 - * @tc.name Test getUniqueDeviceId(-1) to check the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_getUniqueDeviceId_Promise_0500', 0, async function (done) { - radio.getUniqueDeviceId(SLOT_2).then(data => { - console.log(`Telephony_NetworkSearch_getUniqueDeviceId_Promise_0500 end data: ${data}`); - expect(data === '').assertTrue(); - done(); - }).catch(err => { - console.log(`Telephony_NetworkSearch_getUniqueDeviceId_Promise_0500 fail: ${err}`); - expect().assertFail(); - done(); - }) - }); - - /** - * @tc.number Telephony_NetworkSearch_getNrOptionMode_Async_0500 - * @tc.name Test getNrOptionMode(-1) to check the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_getNrOptionMode_Async_0500', 0, async function (done) { - radio.getNrOptionMode(SLOT_2, (err, data) => { - if (err) { - console.log(`Telephony_NetworkSearch_getNrOptionMode_Async_0500 get fail err: ${err}`); - expect().assertFail(); - done(); - return; - } - console.log(`Telephony_NetworkSearch_getNrOptionMode_Async_0500 end data: ${JSON.stringify(data)}`); - expect(data === radio.NR_OPTION_UNKNOWN).assertTrue(); - done(); - }); - }) - - /** - * @tc.number Telephony_NetworkSearch_getNrOptionMode_Promise_0500 - * @tc.name Test getNrOptionMode(-1) to check the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_getNrOptionMode_Promise_0500', 0, async function (done) { - radio.getNrOptionMode(SLOT_2).then(data => { - console.log(`Telephony_NetworkSearch_getNrOptionMode_Promise_0500 end data: ${data}`); - expect(data === radio.NR_OPTION_UNKNOWN).assertTrue(); - done(); - }).catch(err => { - console.log(`Telephony_NetworkSearch_getNrOptionMode_Promise_0500 fail: ${err}`); - expect().assertFail(); - done(); - }) - }); - - /** - * @tc.number Telephony_NetworkSearch_turnOnRadio_Async_0200 - * @tc.name Test The function turnOnRadio - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_turnOnRadio_Async_0200', 0, async function (done) { - radio.turnOnRadio((err) => { - if (err) { - console.log(`Telephony_NetworkSearch_turnOnRadio_Async_0200 turnOn fail: ${err}`); - done(); - return; - } - console.log('Telephony_NetworkSearch_turnOnRadio_Async_0200 turnOn finish'); - done(); - }); - }); - - /** - * @tc.number Telephony_NetworkSearch_turnOnRadio_Promise_0200 - * @tc.name Test The function turnOnRadio - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_turnOnRadio_Promise_0200', 0, async function (done) { - try { - await radio.turnOnRadio(); - console.log('Telephony_NetworkSearch_turnOnRadio_Promise_0200 success'); - done(); - } catch (err) { - console.log(`Telephony_NetworkSearch_turnOnRadio_Promise_0200 fail ${err}`); - done(); - } - }); - - /** - * @tc.number Telephony_NetworkSearch_turnOffRadio_Async_0200 - * @tc.name Test The function turnOffRadio - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_turnOffRadio_Async_0200', 0, async function (done) { - radio.turnOffRadio((err) => { - if (err) { - console.log(`Telephony_NetworkSearch_turnOffRadio_Async_0200 turnOff fail: ${err}`); - done(); - return; - } - console.log('Telephony_NetworkSearch_turnOffRadio_Async_0200 turnOff finish'); - done(); - }); - }); - - /** - * @tc.number Telephony_NetworkSearch_turnOffRadio_Promise_0200 - * @tc.name Test The function turnOffRadio - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_turnOffRadio_Promise_0200', 0, async function (done) { - try { - await radio.turnOffRadio(); - console.log('Telephony_NetworkSearch_turnOffRadio_Promise_0200 success'); - done(); - } catch (err) { - console.log(`Telephony_NetworkSearch_turnOffRadio_Promise_0200 fail ${err}`); - done(); - } - }); - + /** * @tc.number Telephony_NetworkSearch_isRadioOn_Async_0200 * @tc.name Test The function isRadioOn diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/SimJsunit.test.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/SimJsunit.test.ets deleted file mode 100644 index 722f5dfb3e207739ca35d3aeecb5350adc1d696e..0000000000000000000000000000000000000000 --- a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/SimJsunit.test.ets +++ /dev/null @@ -1,168 +0,0 @@ -// @ts-nocheck -/** - * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets"; -import sim from '@ohos.telephony.sim'; -import * as env from './lib/Const.js'; -import utils from './Utils.ets' -export default function simJsunit() { - describe('appInfoTest', function () { - console.log("************* sim Test start*************"); - /** - * @tc.number Telephony_Sim_getOperatorConfigs_Async_0100 - * @tc.name The slotId parameter is 0 and the OperatorConfig structure is not expected to be empty - * @tc.desc Function test - */ - it('Telephony_Sim_getOperatorConfigs_Async_0100', 0, async function (done) { - if (utils.notCheck) { - expect(true).assertTrue(); - done(); - return; - } - console.log('Telephony_Sim_getOperatorConfigs_Async_0100 start'); - let containerIsEmpty = 0; - sim.getOperatorConfigs(env.DEFAULT_SLOTID, (err, data) => { - console.log('Telephony_Sim_getOperatorConfigs_Async_0100 result'); - if (err) { - console.log(`Telephony_Sim_getOperatorConfigs_Async_0100 fail, err : ${err.message}`); - done(); - return; - } - expect(Object.keys(data).length !== containerIsEmpty).assertTrue(); - expect(data.field !== containerIsEmpty).assertTrue(); - expect(data.value !== containerIsEmpty).assertTrue(); - console.log('Telephony_Sim_getOperatorConfigs_Async_0100 finish'); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_getSimAccountInfo_Async_0100 - * @tc.name Get the return value by calling the GetSimAccountInfo interface SIM ID input parameter 0. - * @tc.desc Function test - */ - it('Telephony_Sim_getSimAccountInfo_Async_0100', 0, async function (done) { - if (utils.notCheck) { - expect(true).assertTrue(); - done(); - return; - } - const CASE_NAME = 'Telephony_Sim_getSimAccountInfo_Async_0100'; - let iccIdValue; - sim.getSimAccountInfo(env.DEFAULT_SLOTID, (err, info) => { - if (err) { - console.log(`${CASE_NAME} fail ,err : ${err.message}`); - done(); - return; - } - console.log(`${CASE_NAME} getSimAccountInfo: ${JSON.stringify(info)}`); - expect(info.slotIndex === env.DEFAULT_SLOTID - && info.isEsim === false - && info.isActive === true - && info.iccId === iccIdValue - && info.showName === env.SIM_SLOT_NAME - && info.showNumber === env.SIM_SLOT_NUMBER - && info.simId === "simId" - ).assertTrue(); - console.log(`${CASE_NAME} finish`); - done(); - }); - }); - /** - * @tc.number Telephony_Sim_unlockPin_Async_0100 - * @tc.name Test the unlockPin interface when the card status is ready state. - * @tc.desc Function test - */ - it('Telephony_Sim_unlockPin_Async_0100', 0, async function (done) { - if (utils.notCheck) { - expect(true).assertTrue(); - done(); - return; - } - let PIN = '1234'; - sim.unlockPin(env.DEFAULT_SLOTID, PIN, (err, data) => { - if (err) { - console.log(`Telephony_Sim_unlockPin_Async_0100 fail, err: ${err.message}`); - done(); - return; - } - expect(data.result === env.OTHER_ABNORMAL).assertTrue(); - console.log('Telephony_Sim_unlockPin_Async_0100 finish'); - done(); - }); - }); - /** - * @tc.number Telephony_Sim_addIccDiallingNumbers_Async_0100 - * @tc.name Test sim.addIccDiallingNumbers(soltId: -1, type: 1, diallingNumbers: - * {recordNumber: 1, alphaTag: 'test', number: '12345678', pin2: '123@#ABCD'}, - * callback: AsyncCallback) async callback interface, expect enter error. - * @tc.desc Function test - */ - const CONTACT_INFO = { 'recordNumber': 1, 'alphaTag': 'test', 'number': '12345678' }; - const GENERAL_CONTACT_INFO = Object.assign({}, { 'pin2': env.INCORRECT_PIN2 }, CONTACT_INFO); - it('Telephony_Sim_addIccDiallingNumbers_Async_0100', 0, async function (done) { - if (utils.notCheck) { - expect(true).assertTrue(); - done(); - return; - } - const CASE_NAME = 'Telephony_Sim_addIccDiallingNumbers_Async_0100'; - var number = env.SLOTID_MINUS1; - sim.addIccDiallingNumbers(number, - sim.GENERAL_CONTACT, - GENERAL_CONTACT_INFO, - error => { - if (error) { - console.log(`${CASE_NAME} expect error: ${error.message}`); - console.log(`${CASE_NAME} finish.`); - } else { - console.log(`${CASE_NAME} test fail.`); - expect().assertFail(); - } - done(); - }); - }); - /** - * @tc.number Telephony_Sim_SetLockState_Async_0100 - * @tc.name Test the SetLockState async callback interface to open the PIN lock and check the callback value - * @tc.desc Function test - */ - it('Telephony_Sim_SetLockState_Async_0100', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_SetLockState_Async_0100'; - if (utils.notCheck) { - expect(true).assertTrue(); - done(); - return; - } - const lockInfo = { lockType: sim.PIN_LOCK, state: sim.LOCK_ON, password: env.CORRECT_PIN }; - await setPinLockState(sim.LOCK_OFF); - sim.setLockState(env.DEFAULT_SLOTID, lockInfo, (error, lockStatusResponse) => { - if (error) { - console.log(`${CASE_NAME} setLockState error: ${error.message}`); - expect().assertFail(); - done(); - return; - } - if (lockStatusResponse.result !== env.LOCK_RESULT.SUCCESS) { - console.log(`${CASE_NAME} setLockState failure, lock status response: ${lockStatusResponse.result}`); - expect().assertFail(); - done(); - return; - } - }); - }); - console.log("************* sim Test end*************"); - }) -} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/SmsMmsJsunit.test.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/SmsMmsJsunit.test.ets deleted file mode 100644 index 8e5fba7f4cb5cdd93dead2ceb494205c20041251..0000000000000000000000000000000000000000 --- a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/SmsMmsJsunit.test.ets +++ /dev/null @@ -1,928 +0,0 @@ -// @ts-nocheck -/** - * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets"; -import mms from '@ohos.telephony.sms'; -import utils from './Utils.ets' -export default function smsUiJsunit() { - describe('appInfoTest', function () { - /** - * @tc.number Telephony_SmsMms_encodeMms_Async_0100 - * @tc.name SendReq type MMS, encoding after decoding, the content after decoding and coding before the same - * @tc.desc Function test - */ - it('Telephony_SmsMms_encodeMms_Async_0100', 0, async function (done) { - if (utils.notCheck) { - expect(true).assertTrue(); - done(); - return; - } - let mmsType = { - "from": { - address: '+861381234****/TYPE=PLMN', charset: mms.UTF_8 - }, - to: [{ - address: '+861388888****/TYPE=PLMN', charset: mms.UTF_8 - }], - transactionId: '2077.1427358451410', - version: mms.MMS_VERSION_1_2, - date: 1639378126, - cc: [{ - address: "+861381111****/TYPE=PLMN", charset: mms.UTF_8 - }], - bcc: [{ - address: "+861382222****/TYPE=PLMN", charset: mms.UTF_8 - }], - subject: "Test mms", - messageClass: 130, - expiry: 1639378126, - priority: mms.MMS_LOW, - senderVisibility: 129, - deliveryReport: 128, - readReport: 129, - contentType: "application/vnd.wap.multipart.related", - }; - let attachment = [ - { - path: '/data/telephony/enSrc/content.text', - fileName: 'content.text', - contentId: '', - contentLocation: 'content.text', - contentDisposition: mms.FROM_DATA, - contentTransferEncoding: 'base64', - contentType: 'text/plain', - isSmil: false, - inBuff: [], - charset: mms.UTF_8 - }, - { - path: '/data/telephony/enSrc/618C0A89.smil', - fileName: '618C0A89.smil', - contentId: '<0000>', - contentLocation: '618C0A89.smil', - contentDisposition: mms.ATTACHMENT, - contentTransferEncoding: 'base64', - contentType: 'application/smil', - isSmil: true, - inBuff: [], - charset: mms.UTF_8 - }, - { - path: '/data/telephony/enSrc/picture.gif', - fileName: 'picture.gif', - contentId: '', - contentLocation: 'picture.gif', - contentDisposition: mms.INLINE, - contentTransferEncoding: 'base64', - contentType: 'image/gif', - isSmil: false, - inBuff: [], - charset: mms.UTF_8 - }]; - - mms.encodeMms({ - messageType: mms.TYPE_MMS_SEND_REQ, mmsType, attachment - }, (err, encodeData) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0100 encodeMms fail'); - done(); - return; - } - console.log('Telephony_SmsMms_encodeMms_Async_0100 encodeMms finish'); - mms.decodeMms(encodeData, (err, data) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0100 fail'); - done(); - return; - } - expect(data.messageType === mms.TYPE_MMS_SEND_REQ).assertTrue(); - expect(data.mmsType.from.address === '+861381234****/TYPE=PLMN').assertTrue(); - expect(data.mmsType.from.charset === mms.UTF_8).assertTrue(); - expect(data.mmsType.to.length > 0).assertTrue(); - expect(data.mmsType.to[0].address === '+861388888****/TYPE=PLMN').assertTrue(); - expect(data.mmsType.to[0].charset === mms.UTF_8).assertTrue(); - expect(data.mmsType.transactionId === '2077.1427358451410').assertTrue(); - expect(data.mmsType.version === mms.MMS_VERSION_1_2).assertTrue(); - expect(data.mmsType.date > 0).assertTrue(); - expect(data.mmsType.cc.length > 0).assertTrue(); - expect(data.mmsType.cc[0].address === '+861381111****/TYPE=PLMN').assertTrue(); - expect(data.mmsType.cc[0].charset === mms.UTF_8).assertTrue(); - expect(data.mmsType.bcc.length > 0).assertTrue(); - expect(data.mmsType.bcc[0].address === '+861382222****/TYPE=PLMN').assertTrue(); - expect(data.mmsType.bcc[0].charset === mms.UTF_8).assertTrue(); - expect(data.mmsType.subject === 'Test mms').assertTrue(); - expect(data.mmsType.messageClass === 130).assertTrue(); - expect(data.mmsType.expiry !== 0).assertTrue(); - expect(data.mmsType.priority === mms.MMS_LOW).assertTrue(); - expect(data.mmsType.senderVisibility === 129).assertTrue(); - expect(data.mmsType.deliveryReport === 128).assertTrue(); - expect(data.mmsType.readReport === 129).assertTrue(); - expect(data.mmsType.contentType === 'application/vnd.wap.multipart.related').assertTrue(); - if (data.attachment != null) { - expect(data.attachment.length > 0).assertTrue(); - expect(data.attachment[0].path === '').assertTrue(); - expect(data.attachment[0].fileName === '618C0A89.smil').assertTrue(); - expect(data.attachment[0].contentId === '<0000>').assertTrue(); - expect(data.attachment[0].contentLocation === '618C0A89.smil').assertTrue(); - expect(data.attachment[0].contentDisposition === mms.ATTACHMENT).assertTrue(); - expect(data.attachment[0].contentTransferEncoding === 'base64').assertTrue(); - expect(data.attachment[0].contentType === 'application/smil').assertTrue(); - expect(data.attachment[0].isSmil).assertTrue(); - expect(data.attachment[0].inBuff.length > 0).assertTrue(); - expect(data.attachment[0].charset === mms.UTF_8).assertTrue(); - expect(data.attachment[1].path === '').assertTrue(); - expect(data.attachment[1].fileName === 'content.text').assertTrue(); - expect(data.attachment[1].contentId === '').assertTrue(); - expect(data.attachment[1].contentLocation === 'content.text').assertTrue(); - expect(data.attachment[1].contentDisposition === mms.FROM_DATA).assertTrue(); - expect(data.attachment[1].contentTransferEncoding === 'base64').assertTrue(); - expect(data.attachment[1].contentType === 'text/plain').assertTrue(); - expect(data.attachment[1].isSmil).assertFalse(); - expect(data.attachment[1].inBuff.length > 0).assertTrue(); - expect(data.attachment[1].charset === mms.UTF_8).assertTrue(); - expect(data.attachment[2].path === '').assertTrue(); - expect(data.attachment[2].fileName === 'picture.gif').assertTrue(); - expect(data.attachment[2].contentId === '').assertTrue(); - expect(data.attachment[2].contentLocation === 'picture.gif').assertTrue(); - expect(data.attachment[2].contentDisposition === mms.INLINE).assertTrue(); - expect(data.attachment[2].contentTransferEncoding === 'base64').assertTrue(); - expect(data.attachment[2].contentType === 'image/gif').assertTrue(); - expect(data.attachment[2].isSmil).assertFalse(); - expect(data.attachment[2].inBuff.length > 0).assertTrue(); - expect(data.attachment[2].charset === mms.UTF_8).assertTrue(); - console.log('Telephony_SmsMms_encodeMms_Async_0100 finish'); - } - done(); - }); - }); - }); - - /** - * @tc.number Telephony_SmsMms_encodeMms_Async_0200 - * @tc.name SendConf type MMS, encoding after decoding, the content after decoding and coding before the same - * @tc.desc Function test - */ - it('Telephony_SmsMms_encodeMms_Async_0200', 0, async function (done) { - if (utils.notCheck) { - expect(true).assertTrue(); - done(); - return; - } - let mmsType = { - responseState: 128, - transactionId: '2077.1427358451410', - version: mms.MMS_VERSION_1_1, - messageId: '0001', - }; - mms.encodeMms({ - messageType: mms.TYPE_MMS_SEND_CONF, mmsType - }, (err, encodeData) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0200 encodeMms fail'); - done(); - return; - } - console.log('Telephony_SmsMms_encodeMms_Async_0200 encodeMms finish'); - mms.decodeMms(encodeData, (err, data) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0200 fail'); - done(); - return; - } - expect(data.messageType === mms.TYPE_MMS_SEND_CONF).assertTrue(); - expect(data.mmsType.responseState === 128).assertTrue(); - expect(data.mmsType.transactionId === '2077.1427358451410').assertTrue(); - expect(data.mmsType.version === mms.MMS_VERSION_1_1).assertTrue(); - expect(data.mmsType.messageId === '0001').assertTrue(); - console.log('Telephony_SmsMms_encodeMms_Async_0200 finish'); - done(); - }); - }); - }); - - /** - * @tc.number Telephony_SmsMms_encodeMms_Async_0300 - * @tc.name NotificationInd type MMS, encoding after decoding, - * the content after decoding and coding before the same - * @tc.desc Function test - */ - it('Telephony_SmsMms_encodeMms_Async_0300', 0, async function (done) { - let mmsType = { - transactionId: "2080.142730", - messageClass: 128, - messageSize: 12345678, - expiry: 1639378126, - version: mms.MMS_VERSION_1_3, - "from": { - address: '+861381234****/TYPE=PLMN', charset: mms.UTF_8 - }, - subject: "Test mms", - deliveryReport: 128, - contentLocation: "Test", - contentClass: 128, - }; - mms.encodeMms({ - messageType: mms.TYPE_MMS_NOTIFICATION_IND, mmsType - }, (err, encodeData) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0300 encodeMms fail'); - done(); - return; - } - console.log('Telephony_SmsMms_encodeMms_Async_0300 encodeMms finish'); - mms.decodeMms(encodeData, (err, data) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0300 fail'); - done(); - return; - } - expect(data.messageType === mms.TYPE_MMS_NOTIFICATION_IND).assertTrue(); - expect(data.mmsType.transactionId === '2080.142730').assertTrue(); - expect(data.mmsType.messageClass === 128).assertTrue(); - expect(data.mmsType.messageSize === 12345678).assertTrue(); - expect(data.mmsType.expiry !== 0).assertTrue(); - expect(data.mmsType.version === mms.MMS_VERSION_1_3).assertTrue(); - expect(data.mmsType.from.address.length > 0).assertTrue(); - expect(data.mmsType.from.charset === mms.UTF_8).assertTrue(); - expect(data.mmsType.subject === 'Test mms').assertTrue(); - expect(data.mmsType.deliveryReport === 128).assertTrue(); - expect(data.mmsType.contentLocation === 'Test').assertTrue(); - expect(data.mmsType.contentClass === 128).assertTrue(); - console.log('Telephony_SmsMms_encodeMms_Async_0300 finish'); - done(); - }); - }); - }); - - /** - * @tc.number Telephony_SmsMms_encodeMms_Async_0400 - * @tc.name NotifyRespInd type MMS, encoding after decoding,the content after decoding and coding before the same - * @tc.desc Function test - */ - it('Telephony_SmsMms_encodeMms_Async_0400', 0, async function (done) { - let mmsType = { - transactionId: '2920.1410', - status: 128, - version: mms.MMS_VERSION_1_0, - reportAllowed: mms.MMS_YES, - }; - mms.encodeMms({ - messageType: mms.TYPE_MMS_RESP_IND, mmsType - }, (err, encodeData) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0400 encodeMms fail'); - done(); - return; - } - console.log('Telephony_SmsMms_encodeMms_Async_0400 encodeMms finish'); - mms.decodeMms(encodeData, (err, data) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0400 fail'); - done(); - return; - } - expect(data.messageType === mms.TYPE_MMS_RESP_IND).assertTrue(); - expect(data.mmsType.transactionId === '2920.1410').assertTrue(); - expect(data.mmsType.status === 128).assertTrue(); - expect(data.mmsType.version === mms.MMS_VERSION_1_0).assertTrue(); - expect(data.mmsType.reportAllowed === mms.MMS_YES).assertTrue(); - console.log('Telephony_SmsMms_encodeMms_Async_0400 finish'); - done(); - }); - }); - }); - - /** - * @tc.number Telephony_SmsMms_encodeMms_Async_0500 - * @tc.name RetrieveConf type MMS, encoding after decoding, the content after decoding and coding before the same - * @tc.desc Function test - */ - it('Telephony_SmsMms_encodeMms_Async_0500', 0, async function (done) { - let mmsType = { - transactionId: "3077.142410", - messageId: "0001", - date: 1639378126, - version: mms.MMS_VERSION_1_2, - to: [{ - address: "+861388888****/TYPE=PLMN", charset: mms.UTF_8 - }], - "from": { - address: '+861381234****/TYPE=PLMN', charset: mms.UTF_8 - }, - cc: [{ - address: '+861381111****/TYPE=PLMN', charset: mms.UTF_8 - }], - subject: "Test mms", - priority: mms.MMS_HIGH, - deliveryReport: 128, - readReport: 128, - retrieveStatus: 128, - retrieveText: "0002", - contentType: "application/vnd.wap.multipart.related", - }; - mms.encodeMms({ - messageType: mms.TYPE_MMS_RETRIEVE_CONF, mmsType - }, (err, encodeData) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0500 encodeMms fail'); - done(); - return; - } - console.log('Telephony_SmsMms_encodeMms_Async_0500 encodeMms finish'); - mms.decodeMms(encodeData, (err, data) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0500 fail'); - done(); - return; - } - expect(data.messageType === mms.TYPE_MMS_RETRIEVE_CONF).assertTrue(); - expect(data.mmsType.transactionId === '3077.142410').assertTrue(); - expect(data.mmsType.messageId === '0001').assertTrue(); - expect(data.mmsType.date > 0).assertTrue(); - expect(data.mmsType.version === mms.MMS_VERSION_1_2).assertTrue(); - expect(data.mmsType.to.length > 0).assertTrue(); - expect(data.mmsType.to[0].address.length > 0).assertTrue(); - expect(data.mmsType.to[0].charset === mms.UTF_8).assertTrue(); - expect(data.mmsType.from.address.length > 0).assertTrue(); - expect(data.mmsType.from.charset === mms.UTF_8).assertTrue(); - expect(data.mmsType.cc.length > 0).assertTrue(); - expect(data.mmsType.cc[0].address.length > 0).assertTrue(); - expect(data.mmsType.cc[0].charset == mms.UTF_8).assertTrue(); - expect(data.mmsType.subject === 'Test mms').assertTrue(); - expect(data.mmsType.priority === mms.MMS_HIGH).assertTrue(); - expect(data.mmsType.deliveryReport === 128).assertTrue(); - expect(data.mmsType.readReport === 128).assertTrue(); - expect(data.mmsType.retrieveStatus === 128).assertTrue(); - expect(data.mmsType.retrieveText === '0002').assertTrue(); - expect(data.mmsType.contentType === 'application/vnd.wap.multipart.related').assertTrue(); - console.log('Telephony_SmsMms_encodeMms_Async_0500 finish'); - done(); - }); - }); - }); - - /** - * @tc.number Telephony_SmsMms_encodeMms_Async_0600 - * @tc.name AcknowledgeInd type MMS, encoding after decoding, - * the content after decoding and coding before the same - * @tc.desc Function test - */ - it('Telephony_SmsMms_encodeMms_Async_0600', 0, async function (done) { - let mmsType = { - transactionId: "27.14210", - version: mms.MMS_VERSION_1_2, - reportAllowed: mms.MMS_NO, - }; - mms.encodeMms({ - messageType: mms.TYPE_MMS_ACKNOWLEDGE_IND, mmsType - }, (err, encodeData) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0600 encodeMms fail'); - done(); - return; - } - console.log('Telephony_SmsMms_encodeMms_Async_0600 encodeMms finish'); - mms.decodeMms(encodeData, (err, data) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0600 fail'); - done(); - return; - } - expect(data.messageType === mms.TYPE_MMS_ACKNOWLEDGE_IND).assertTrue(); - expect(data.mmsType.transactionId === '27.14210').assertTrue(); - expect(data.mmsType.version === mms.MMS_VERSION_1_2).assertTrue(); - expect(data.mmsType.reportAllowed === mms.MMS_NO).assertTrue(); - console.log('Telephony_SmsMms_encodeMms_Async_0600 finish'); - done(); - }); - }); - }); - - /** - * @tc.number Telephony_SmsMms_encodeMms_Async_0700 - * @tc.name DeliveryInd type MMS, encoding after decoding, the content after decoding and coding before the same - * @tc.desc Function test - */ - it('Telephony_SmsMms_encodeMms_Async_0700', 0, async function (done) { - let mmsType = { - messageId: "0001", - date: 1639378126, - to: [{ - address: "+861388888****/TYPE=PLMN", charset: mms.UTF_8 - }], - status: 134, - version: mms.MMS_VERSION_1_2, - }; - mms.encodeMms({ - messageType: mms.TYPE_MMS_DELIVERY_IND, mmsType - }, (err, encodeData) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0700 encodeMms fail'); - done(); - return; - } - console.log('Telephony_SmsMms_encodeMms_Async_0700 encodeMms finish'); - mms.decodeMms(encodeData, (err, data) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0700 fail'); - done(); - return; - } - expect(data.messageType === mms.TYPE_MMS_DELIVERY_IND).assertTrue(); - expect(data.mmsType.messageId === '0001').assertTrue(); - expect(data.mmsType.date > 0).assertTrue(); - expect(data.mmsType.to.length > 0).assertTrue(); - expect(data.mmsType.to[0].address.length > 0).assertTrue(); - expect(data.mmsType.to[0].charset === mms.UTF_8).assertTrue(); - expect(data.mmsType.status === 134).assertTrue(); - expect(data.mmsType.version === mms.MMS_VERSION_1_2).assertTrue(); - console.log('Telephony_SmsMms_encodeMms_Async_0700 finish'); - done(); - }); - }); - }); - - /** - * @tc.number Telephony_SmsMms_encodeMms_Async_0800 - * @tc.name ReadRecInd type MMS, encoding after decoding, the content after decoding and coding before the same - * @tc.desc Function test - */ - it('Telephony_SmsMms_encodeMms_Async_0800', 0, async function (done) { - let mmsType = { - version: mms.MMS_VERSION_1_0, - messageId: "0001", - to: [{ - address: "+861388888****/TYPE=PLMN", charset: mms.UTF_8 - }], - "from": { - address: "+861381234****/TYPE=PLMN", charset: mms.UTF_8 - }, - date: 1639378126, - readStatus: 128, - }; - mms.encodeMms({ - messageType: mms.TYPE_MMS_READ_REC_IND, mmsType - }, (err, encodeData) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0800 encodeMms fail'); - done(); - return; - } - console.log('Telephony_SmsMms_encodeMms_Async_0800 encodeMms finish'); - mms.decodeMms(encodeData, (err, data) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0800 fail'); - done(); - return; - } - expect(data.messageType === mms.TYPE_MMS_READ_REC_IND).assertTrue(); - expect(data.mmsType.version === mms.MMS_VERSION_1_0).assertTrue(); - expect(data.mmsType.messageId === '0001').assertTrue(); - expect(data.mmsType.to.length > 0).assertTrue(); - expect(data.mmsType.to[0].address.length > 0).assertTrue(); - expect(data.mmsType.to[0].charset === mms.UTF_8).assertTrue(); - expect(data.mmsType.from.address.length > 0).assertTrue(); - expect(data.mmsType.from.charset === mms.UTF_8).assertTrue(); - expect(data.mmsType.readStatus === 128).assertTrue(); - expect(data.mmsType.date > 0).assertTrue(); - console.log('Telephony_SmsMms_encodeMms_Async_0800 finish'); - done(); - }); - }); - }); - - /** - * @tc.number Telephony_SmsMms_encodeMms_Async_0900 - * @tc.name ReadOrigInd type MMS, encoding after decoding, the content after decoding and coding before the same - * @tc.desc Function test - */ - it('Telephony_SmsMms_encodeMms_Async_0900', 0, async function (done) { - let mmsType = { - version: mms.MMS_VERSION_1_1, - messageId: "0001", - to: [{ - address: "+861388888****/TYPE=PLMN", charset: mms.UTF_8 - }], - "from": { - address: "+861381234****/TYPE=PLMN", charset: mms.UTF_8 - }, - readStatus: 129, - date: 1639378126, - }; - mms.encodeMms({ - messageType: mms.TYPE_MMS_READ_ORIG_IND, mmsType - }, (err, encodeData) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0900 encodeMms fail'); - done(); - return; - } - console.log('Telephony_SmsMms_encodeMms_Async_0900 encodeMms finish'); - mms.decodeMms(encodeData, (err, data) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0900 fail'); - done(); - return; - } - expect(data.messageType === mms.TYPE_MMS_READ_ORIG_IND).assertTrue(); - expect(data.mmsType.version === mms.MMS_VERSION_1_1).assertTrue(); - expect(data.mmsType.messageId === '0001').assertTrue(); - expect(data.mmsType.to.length > 0).assertTrue(); - expect(data.mmsType.to[0].address.length > 0).assertTrue(); - expect(data.mmsType.to[0].charset === mms.UTF_8).assertTrue(); - expect(data.mmsType.from.address.length > 0).assertTrue(); - expect(data.mmsType.from.charset === mms.UTF_8).assertTrue(); - expect(data.mmsType.date > 0).assertTrue(); - expect(data.mmsType.readStatus === 129).assertTrue(); - console.log('Telephony_SmsMms_encodeMms_Async_0900 finish'); - done(); - }); - }); - }); - /** - * @tc.number Telephony_SmsMms_encodeMms_Async_0900 - * @tc.name RetrieveConf type MMS, encoding after decoding, the content after decoding and coding before the same - * @tc.desc Function test - */ - it('Telephony_SmsMms_encodeMms_Async_0900', 0, async function (done) { - let mmsType = { - transactionId: "3077.142410", - messageId: "0001", - date: 1639378126, - version: mms.MMS_VERSION_1_2, - to: [{ - address: "+861388888****/TYPE=PLMN", charset: mms.UTF_8 - }], - "from": { - address: '+861381234****/TYPE=PLMN', charset: mms.UTF_8 - }, - cc: [{ - address: '+861381111****/TYPE=PLMN', charset: mms.UTF_8 - }], - subject: "Test mms", - priority: mms.MMS_NORMAL, - deliveryReport: 128, - readReport: 128, - retrieveStatus: 128, - retrieveText: "0002", - contentType: "application/vnd.wap.multipart.related", - }; - mms.encodeMms({ - messageType: mms.TYPE_MMS_RETRIEVE_CONF, mmsType - }, (err, encodeData) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0900 encodeMms fail'); - done(); - return; - } - console.log('Telephony_SmsMms_encodeMms_Async_0900 encodeMms finish'); - mms.decodeMms(encodeData, (err, data) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0500 fail'); - done(); - return; - } - expect(data.messageType === mms.TYPE_MMS_RETRIEVE_CONF).assertTrue(); - expect(data.mmsType.transactionId === '3077.142410').assertTrue(); - expect(data.mmsType.messageId === '0001').assertTrue(); - expect(data.mmsType.date > 0).assertTrue(); - expect(data.mmsType.version === mms.MMS_VERSION_1_2).assertTrue(); - expect(data.mmsType.to.length > 0).assertTrue(); - expect(data.mmsType.to[0].address.length > 0).assertTrue(); - expect(data.mmsType.to[0].charset === mms.UTF_8).assertTrue(); - expect(data.mmsType.from.address.length > 0).assertTrue(); - expect(data.mmsType.from.charset === mms.UTF_8).assertTrue(); - expect(data.mmsType.cc.length > 0).assertTrue(); - expect(data.mmsType.cc[0].address.length > 0).assertTrue(); - expect(data.mmsType.cc[0].charset == mms.UTF_8).assertTrue(); - expect(data.mmsType.subject === 'Test mms').assertTrue(); - expect(data.mmsType.priority === mms.MMS_NORMAL).assertTrue(); - expect(data.mmsType.deliveryReport === 128).assertTrue(); - expect(data.mmsType.readReport === 128).assertTrue(); - expect(data.mmsType.retrieveStatus === 128).assertTrue(); - expect(data.mmsType.retrieveText === '0002').assertTrue(); - expect(data.mmsType.contentType === 'application/vnd.wap.multipart.related').assertTrue(); - console.log('Telephony_SmsMms_encodeMms_Async_0500 finish'); - done(); - }); - }); - }); - - const SMS_SEND_DST_NUMBER = ''; - const TRUE_SLOT_ID = 0; - const FALSE_SLOT_ID = 9; - const OTHER_SLOT_ID = 1; - const SECOND_SLOT_ID = 2; - const IDENTIFIER_MIN = 0; - const IDENTIFIER_MAX = 0xFFFF; - const RANTYPE_GSM = 1; - const RANTYPE_CDMA = 2; - const RANTYPE_ERROR = 3; - var rawArray = [ - 0x08, 0x91, 0x68, 0x31, 0x08, 0x20, 0x00, 0x75, 0xF4, 0x24, 0x0D, 0x91, - 0x68, 0x81, 0x29, 0x56, 0x29, 0x83, 0xF6, 0x00, 0x00, 0x12, 0x40, 0x80, - 0x01, 0x02, 0x14, 0x23, 0x02, 0xC1, 0x30 - ] - /** - * @tc.number Telephony_SmsMms_setCBConfig_Async_0100 - * @tc.name Set "StartMessageld" to minimum(0x0000) and "EndMessageld" to minimum(0x0000) for cell broadcast, - * Configure a cell broadcast for an identity. - * @tc.desc Function test - */ - it('Telephony_SmsMms_setCBConfig_Async_0100', 0, async function (done) { - if (true) { - expect(true).assertTrue(); - done(); - return; - } - let data = { - slotId: TRUE_SLOT_ID, - enable: true, - startMessageId: IDENTIFIER_MIN, - endMessageId: IDENTIFIER_MIN, - ranType: RANTYPE_GSM - }; - sms.setCBConfig(data, (err) => { - if (err) { - expect().assertFail(); - console.log('Telephony_SmsMms_setCBConfig_Async_0100 fail'); - done(); - return; - } - console.log('Telephony_SmsMms_setCBConfig_Async_0100 finish'); - done(); - }); - }); - - /** - * @tc.number Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 - * @tc.name When SLOTID is the correct value,Query all SMS records of the SIM card. - * @tc.desc Function test - */ - it('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100', 0, async function (done) { - if (true) { - expect(true).assertTrue(); - done(); - return; - } - let data = { - slotId: TRUE_SLOT_ID, - smsc: '', - pdu: CORRECT_SMS_PDU, - status: sms.SIM_MESSAGE_STATUS_SENT - }; - sms.addSimMessage(data, (adderr) => { - if (adderr) { - expect().assertFail(); - console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 add fail'); - done(); - return; - } - console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 finish '); - sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => { - if (geterr) { - expect().assertFail(); - console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 get fail'); - done(); - return; - } - expect(getresult.length > 0).assertTrue(); - let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu); - let isAdd = (addOfPdu === CORRECT_SMS_PDU && - getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT); - expect(isAdd).assertTrue(); - console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 getAllSimMessages cur finish'); - sms.delSimMessage(TRUE_SLOT_ID, getresult[0].indexOnSim, (delerr) => { - if (delerr) { - expect().assertFail(); - console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 del fail'); - done(); - return; - } - console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 delSimMessage finish'); - sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => { - if (geterr) { - expect().assertFail(); - console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 get 2 fail'); - done(); - return; - } - expect(getresult.length === 0).assertTrue(); - console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 getAllSimMessages cur finish'); - done(); - }); - }); - }); - }); - }); - /* - * @tc.number Telephony_SmsMms_createMessage_Async_0100 - * @tc.name Call interface CreateMessage, - * pass in the PDU(rawArray) in line with the coding specification, the specification is 3GPP, - * shortMessage Don't empty - * @tc.desc Function test - */ - it('Telephony_SmsMms_createMessage_Async_0100', 0, async function (done) { - if (true) { - expect(true).assertTrue(); - done(); - return; - } - sms.createMessage(rawArray, '3gpp', (err, shortMessage) => { - if (err) { - expect().assertFail(); - console.log('Telephony_SmsMms_createMessage_Async_0100 fail'); - done(); - return; - } - expect(shortMessage.visibleMessageBody === MESSAGEBODY).assertTrue(); - expect(shortMessage.visibleRawAddress.length === ADDR_LENGTH).assertTrue(); - expect(shortMessage.messageClass === sms.FORWARD_MESSAGE).assertTrue(); - expect(shortMessage.protocolId === 0).assertTrue(); - expect(shortMessage.scAddress.length === ADDR_LENGTH).assertTrue(); - expect(shortMessage.scTimestamp === SC_TIMESTAMP).assertTrue(); - expect(shortMessage.isReplaceMessage).assertFalse(); - expect(shortMessage.hasReplyPath).assertFalse(); - expect(shortMessage.pdu.length > 0).assertTrue(); - expect(shortMessage.status === 0).assertTrue(); - expect(shortMessage.isSmsStatusReportMessage).assertTrue(); - console.log('Telephony_SmsMms_createMessage_Async_0100 finish'); - done(); - }); - }); - - /* - * @tc.number Telephony_SmsMms_sendMessage_0100 - * @tc.name Call the interface sendMessage, set the card slot parameter "slotId" to 1, - * and send SMS successfully - * @tc.desc Function test - */ - it('Telephony_SmsMms_sendMessage_0100', 0, async function (done) { - if (true) { - expect(true).assertTrue(); - done(); - return; - } - sms.sendMessage({ - slotId: TRUE_SLOT_ID, - destinationHost: SMS_SEND_DST_NUMBER, - content: '111111', - sendCallback: (err, value) => { - if (err) { - expect().assertFail(); - console.log('Telephony_SmsMms_sendMessage_0100 sendCallback fail'); - done(); - return; - } - expect(value.result === sms.SEND_SMS_SUCCESS).assertTrue(); - console.log('Telephony_SmsMms_sendMessage_0100 sendCallback finish'); - done() - }, - deliveryCallback: (err, value) => { - if (err) { - expect().assertFail(); - console.log('Telephony_SmsMms_sendMessage_0100 deliveryCallback fail'); - done(); - return; - } - expect(value.pdu.length !== 0).assertTrue(); - console.log('Telephony_SmsMms_sendMessage_0100 deliveryCallback finish'); - done(); - } - }); - }); - /* - * @tc.number Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 - * @tc.name set message to plain Chinese with a length of MAX_CHINESE_MESSAGE_LENTH(63) characters, - * and view the result - * @tc.desc Function test - */ - it('Telephony_SmsMms_getSmsSegmentsInfo_Async_0100', 0, async function (done) { - if (true) { - expect(true).assertTrue(); - done(); - return; - } - let message = ''; - for (let index = 0;index < MAX_CHINESE_MESSAGE_LENTH; index++) { - message += '中'; - } - let force7BitCode = true; - sms.getSmsSegmentsInfo(TRUE_SLOT_ID, message, force7BitCode, (error, result) => { - if (error) { - console.log("Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 getSmsSegmentsInfoon error " + error.message); - console.log('Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 fail'); - expect().assertFail(); - } else { - console.log("Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 splitCount " + result.splitCount); - console.log("Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 encodeCount " + result.encodeCount); - console.log("Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 encodeCountRemaining " + - result.encodeCountRemaining); - console.log("Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 scheme " + result.scheme); - - expect(result.splitCount === DIVIDE_MESSAGE_INTO_1).assertTrue(); - expect(result.encodeCount === MAX_CHINESE_MESSAGE_LENTH).assertTrue(); - let remaining = result.splitCount * MAX_CHAR_MESSAGE_LENTH - result.encodeCount; - console.log("Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 remaining " + remaining); - expect(result.encodeCountRemaining === remaining).assertTrue(); - expect(result.scheme === sms.SMS_ENCODING_7BIT).assertTrue(); - console.log('Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 finish'); - } - done(); - }); - }); - - /* - * @tc.number Telephony_SmsMms_getSmsEncodingScheme_Async_0100 - * @tc.name - * @tc.desc Function test - */ - it('Telephony_SmsMms_getSmsEncodingScheme_Async_0100', 0, async function (done) { - if (true) { - expect(true).assertTrue(); - done(); - return; - } - expect(sms.SMS_ENCODING_UNKNOWN == 0).assertTrue(); - expect(sms.SMS_ENCODING_7BIT == 1).assertTrue(); - expect(sms.SMS_ENCODING_8BIT == 2).assertTrue(); - expect(sms.SMS_ENCODING_16BIT == 3).assertTrue(); - done(); - }); - - /* - * @tc.number Telephony_SmsMms_getSendSmsResult_Async_0100 - * @tc.name - * @tc.desc Function test - */ - it('Telephony_SmsMms_getSendSmsResult_Async_0100', 0, async function (done) { - if (true) { - expect(true).assertTrue(); - done(); - return; - } - expect(sms.SEND_SMS_FAILURE_RADIO_OFF == 0).assertTrue(); - expect(sms.SEND_SMS_FAILURE_SERVICE_UNAVAILABLE == 1).assertTrue(); - expect(sms.SIM_MESSAGE_STATUS_FREE == 0).assertTrue(); - expect(sms.INSTANT_MESSAGE == 1).assertTrue(); - expect(sms.OPTIONAL_MESSAGE == 2).assertTrue(); - done(); - }); - - /* - * @tc.number Telephony_SmsMms_ShortMessageClass_Async_0100 - * @tc.name - * @tc.desc Function test - */ - it('Telephony_SmsMms_ShortMessageClass_Async_0100', 0, async function (done) { - if (true) { - expect(true).assertTrue(); - done(); - return; - } - expect(sms.SIM_MESSAGE_STATUS_FREE == 0).assertTrue(); - expect(sms.INSTANT_MESSAGE == 1).assertTrue(); - expect(sms.OPTIONAL_MESSAGE == 2).assertTrue(); - done(); - }); - /* - * @tc.number Telephony_SmsMms_getMmsCharSets_Async_0100 - * @tc.name - * @tc.desc Function test - */ - it('Telephony_SmsMms_getMmsCharSets_Async_0100', 0, async function (done) { - if (true) { - expect(true).assertTrue(); - done(); - return; - } - expect(sms.BIG5 == 0X07EA).assertTrue(); - expect(sms.ISO_10646_UCS_2 == 0X03E8).assertTrue(); - expect(sms.ISO_8859_1 == 0X04).assertTrue(); - expect(sms.ISO_8859_2 == 0X05).assertTrue(); - expect(sms.ISO_8859_3 == 0X06).assertTrue(); - expect(sms.ISO_8859_4 == 0X07).assertTrue(); - expect(sms.ISO_8859_5 == 0X08).assertTrue(); - expect(sms.ISO_8859_6 == 0X09).assertTrue(); - expect(sms.ISO_8859_7 == 0X10).assertTrue(); - expect(sms.ISO_8859_8 == 0X12).assertTrue(); - expect(sms.ISO_8859_9 == 0X13).assertTrue(); - expect(sms.SHIFT_JIS == 0X11).assertTrue(); - expect(sms.US_ASCII == 0X03).assertTrue(); - expect(sms.UTF_8 == 0X6A).assertTrue(); - done(); - }); - }) -} diff --git a/telephony/telephonyjstest/new_add/BUILD.gn b/telephony/telephonyjstest/observer/BUILD.gn similarity index 93% rename from telephony/telephonyjstest/new_add/BUILD.gn rename to telephony/telephonyjstest/observer/BUILD.gn index 9feab10c4ebb26934a9146053976007e397577e1..0e91eb86eba5e202a6c28dcf52065c9ad6678767 100644 --- a/telephony/telephonyjstest/new_add/BUILD.gn +++ b/telephony/telephonyjstest/observer/BUILD.gn @@ -13,7 +13,7 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsNewAddEtsTest") { +ohos_js_hap_suite("ActsObserverEtsTest") { hap_profile = "./entry/src/main/config.json" deps = [ ":ace_demo_ets_assets", @@ -21,7 +21,7 @@ ohos_js_hap_suite("ActsNewAddEtsTest") { ] ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsNewAddEtsTest" + hap_name = "ActsObserverEtsTest" } ohos_js_assets("ace_demo_ets_assets") { source_dir = "./entry/src/main/ets/MainAbility" diff --git a/telephony/telephonyjstest/observer/Test.json b/telephony/telephonyjstest/observer/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..1e5f519576f040a40ecc4bc8aa0f7e4f48957361 --- /dev/null +++ b/telephony/telephonyjstest/observer/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "1500000", + "package": "com.ohos.observer", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsObserverEtsTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/config.json b/telephony/telephonyjstest/observer/entry/src/main/config.json similarity index 97% rename from telephony/telephonyjstest/new_add/entry/src/main/config.json rename to telephony/telephonyjstest/observer/entry/src/main/config.json index 9cfe1594902efb0ec8d859759196d940e146da04..349a4cc8e1f3ddee1c8ddee6b5d3c0e838c631f9 100644 --- a/telephony/telephonyjstest/new_add/entry/src/main/config.json +++ b/telephony/telephonyjstest/observer/entry/src/main/config.json @@ -1,6 +1,6 @@ { "app": { - "bundleName": "com.ohos.newadd", + "bundleName": "com.ohos.observer", "vendor": "open", "version": { "code": 1000000, @@ -14,7 +14,7 @@ }, "deviceConfig": {}, "module": { - "package": "com.ohos.newadd", + "package": "com.ohos.observer", "name": ".MyApplication", "mainAbility": ".MainAbility", "srcPath": "MainAbility", diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/app.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/app.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/app.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Badge.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Badge.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Badge.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Badge.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Blank.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Blank.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Blank.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Blank.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Button.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Button.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Button.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Button.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Column.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Column.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Column.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Column.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Counter.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Counter.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Counter.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Counter.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/DataPanel.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/DataPanel.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/DataPanel.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/DataPanel.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Divider.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Divider.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Divider.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Divider.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Flex.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Flex.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Flex.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Flex.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/GridContainer.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/GridContainer.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/GridContainer.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/GridContainer.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Image.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Image.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Image.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Image.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Navigator.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Navigator.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Navigator.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Navigator.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Panel.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Panel.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Panel.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Panel.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Progress.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Progress.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Progress.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Progress.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Qrcode.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Qrcode.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Qrcode.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Qrcode.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Rating.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Rating.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Rating.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Rating.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/RowSplit.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/RowSplit.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/RowSplit.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/RowSplit.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Scroll.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Scroll.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Scroll.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Scroll.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Slider.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Slider.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Slider.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Slider.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Span.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Span.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Span.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Span.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Stack.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Stack.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Stack.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Stack.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Text.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Text.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Text.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/Text.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/index.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/index.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/test/List.test.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..a9cdf9b1dcc44db45434e415d954fd1410a0269e --- /dev/null +++ b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,24 @@ +/** + * 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. + */ + +//other import + +import observer from './ObserverJsunit.test.ets' + +export default function testsuite() { + + observer(); + +} \ No newline at end of file diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/ObserverJsunit.test.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/test/ObserverJsunit.test.ets similarity index 93% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/ObserverJsunit.test.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/test/ObserverJsunit.test.ets index c380826a013cc0e76c89ca9255a5f0f0b29a0965..6261c3259e002b99d1f6a7cf97bd8c39660d1f2d 100644 --- a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/ObserverJsunit.test.ets +++ b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/test/ObserverJsunit.test.ets @@ -191,58 +191,7 @@ export default function observerJsunit() { done() }) - /* - * @tc.number : Telephony_observer_observer_on_cellInfoChange_0100 - * @tc.name : on_cellInfoChange - * @tc.desc : call the on method of cellInfoChange - */ - it('Telephony_observer_observer_on_cellInfoChange_0100', 0, async function (done) { - console.log("************* Telephony_observer_observer_on_cellInfoChange_0100 Test start *************") - observer.on('cellInfoChange', (cellInformation) => { - expect().assertFail() - done() - return - }) - setTimeout(timeout, 3000) - console.log("************* Telephony_observer_observer_on_cellInfoChange_0100 Test end *************") - done() - }) - - /* - * @tc.number : Telephony_observer_observer_on_cellInfoChange_0200 - * @tc.name : on_cellInfoChange - * @tc.desc : call the on method of cellInfoChange - */ - it('Telephony_observer_observer_on_cellInfoChange_0200', 0, async function (done) { - console.log("************* Telephony_observer_observer_on_cellInfoChange_0200 Test start *************") - observer.on('cellInfoChange', { - slotId: SLOT_0 - }, (cellInformation) => { - expect().assertFail() - done() - return - }) - setTimeout(timeout, 3000) - console.log("************* Telephony_observer_observer_on_cellInfoChange_0200 Test end *************") - done() - }) - - /* - * @tc.number : Telephony_observer_observer_off_cellInfoChange_0100 - * @tc.name : off_cellInfoChange - * @tc.desc : call the off method of cellInfoChange - */ - it('Telephony_observer_observer_off_cellInfoChange_0100', 0, async function (done) { - console.log("************* Telephony_observer_observer_off_cellInfoChange_0100 Test start *************") - observer.off('cellInfoChange', (cellInformation) => { - expect().assertFail() - done() - return - }) - setTimeout(timeout, 3000) - console.log("************* Telephony_observer_observer_off_cellInfoChange_0100 Test end *************") - done() - }) + /* * @tc.number : Telephony_observer_observer_on_cellularDataConnectionStateChange_0100 diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/Utils.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/test/Utils.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/Utils.ets rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/test/Utils.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/lib/Const.js b/telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/test/lib/Const.js similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/lib/Const.js rename to telephony/telephonyjstest/observer/entry/src/main/ets/MainAbility/test/lib/Const.js diff --git a/telephony/telephonyjstest/new_add/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/observer/entry/src/main/resources/base/element/string.json similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/resources/base/element/string.json rename to telephony/telephonyjstest/observer/entry/src/main/resources/base/element/string.json diff --git a/telephony/telephonyjstest/new_add/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/observer/entry/src/main/resources/base/media/icon.png similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/resources/base/media/icon.png rename to telephony/telephonyjstest/observer/entry/src/main/resources/base/media/icon.png diff --git a/telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/hand.png b/telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/hand.png similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/hand.png rename to telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/hand.png diff --git a/telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/icon.png b/telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/icon.png similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/icon.png rename to telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/icon.png diff --git a/telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/images.jpg b/telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/images.jpg similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/images.jpg rename to telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/images.jpg diff --git a/telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/person.png b/telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/person.png similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/person.png rename to telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/person.png diff --git a/telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/star-1-1.png b/telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/star-1-1.png similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/star-1-1.png rename to telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/star-1-1.png diff --git a/telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/star-1-2.png b/telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/star-1-2.png similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/star-1-2.png rename to telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/star-1-2.png diff --git a/telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/star-1-3.png b/telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/star-1-3.png similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/star-1-3.png rename to telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/star-1-3.png diff --git a/telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/video/show.mp4 b/telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/video/show.mp4 similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/video/show.mp4 rename to telephony/telephonyjstest/observer/entry/src/main/resources/rawfile/video/show.mp4 diff --git a/telephony/telephonyjstest/new_add/signature/openharmony_sx.p7b b/telephony/telephonyjstest/observer/signature/openharmony_sx.p7b similarity index 100% rename from telephony/telephonyjstest/new_add/signature/openharmony_sx.p7b rename to telephony/telephonyjstest/observer/signature/openharmony_sx.p7b diff --git a/telephony/telephonyjstest/radiostatistic/BUILD.gn b/telephony/telephonyjstest/radiostatistic/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..a5f14455b09221e821a48f199d3f6f49a57037fe --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/BUILD.gn @@ -0,0 +1,32 @@ +# 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("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsRadiostatisticEtsTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":ace_demo_ets_assets", + ":ace_demo_ets_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsRadiostatisticEtsTest" +} +ohos_js_assets("ace_demo_ets_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("ace_demo_ets_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/telephony/telephonyjstest/new_add/Test.json b/telephony/telephonyjstest/radiostatistic/Test.json similarity index 78% rename from telephony/telephonyjstest/new_add/Test.json rename to telephony/telephonyjstest/radiostatistic/Test.json index a83417445a6b1e50d9e6e4424f0f6815f29aed0f..cf76cebbce9cbd831bb69179c9e722aa5575f283 100644 --- a/telephony/telephonyjstest/new_add/Test.json +++ b/telephony/telephonyjstest/radiostatistic/Test.json @@ -3,13 +3,13 @@ "driver": { "type": "JSUnitTest", "test-timeout": "2000000", - "package": "com.ohos.newadd", + "package": "com.ohos.radiostatistic", "shell-timeout": "60000" }, "kits": [ { "test-file-name": [ - "ActsNewAddEtsTest.hap" + "ActsRadiostatisticEtsTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/config.json b/telephony/telephonyjstest/radiostatistic/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..fda9d63dd9bd97c3c48b0b5b28cbb8cf0cdd0e83 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/config.json @@ -0,0 +1,139 @@ +{ + "app": { + "bundleName": "com.ohos.radiostatistic", + "vendor": "open", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.radiostatistic", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.LOCATION", + "reason": "need use ohos.permission.LOCATION" + }, + { + "name":"ohos.permission.SET_TELEPHONY_STATE", + "reason":"need use ohos.permission.SET_TELEPHONY_STATE" + }, + { + "name":"ohos.permission.GET_TELEPHONY_STATE", + "reason":"need use ohos.permission.GET_TELEPHONY_STATE" + }, + { + "name":"ohos.permission.PLACE_CALL", + "reason":"need use ohos.permission.PLACE_CALL" + }, + { + "name":"ohos.permission.READ_CONTACTS", + "reason":"need use ohos.permission.READ_CONTACTS" + }, + { + "name":"ohos.permission.WRITE_CONTACTS", + "reason":"need use ohos.permission.WRITE_CONTACTS" + }, + { + "name":"ohos.permission.SEND_MESSAGES", + "reason":"need use ohos.permission.SEND_MESSAGES" + }, + { + "name":"ohos.permission.RECEIVE_SMS", + "reason":"need use ohos.permission.RECEIVE_SMS" + }, + { + "name":"ohos.permission.READ_CALL_LOG", + "reason":"need use ohos.permission.READ_CALL_LOG" + }, + { + "name":"ohos.permission.GET_NETWORK_INFO", + "reason":"need use ohos.permission.GET_NETWORK_INFO" + }, + { + "name":"ohos.permission.INTERNET", + "reason":"need use ohos.permission.INTERNET" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/Button", + "pages/Blank", + "pages/DataPanel", + "pages/Divider", + "pages/Text", + "pages/RowSplit", + "pages/Scroll", + "pages/Stack", + "pages/Image", + "pages/Progress", + "pages/Qrcode", + "pages/Rating", + "pages/Span", + "pages/Slider", + "pages/Badge", + "pages/Column", + "pages/ColumnSplit", + "pages/Counter", + "pages/Flex", + "pages/GridContainer" + + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/app.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 0000000000000000000000000000000000000000..261fadca29ff0ea310a8bc105ddd1af65e2dd2f6 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * 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. + */ + +export default { + onCreate() { + console.info('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} \ No newline at end of file diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Badge.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Badge.ets new file mode 100644 index 0000000000000000000000000000000000000000..66de6f8e3b9c0360931602dd25d1511878ac63ab --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Badge.ets @@ -0,0 +1,95 @@ +/* + * 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. + */ + +@Entry +@Component +struct badge { + @State counts: number = 33 + @State message: string = 'new' + @State active: boolean = false + private content: string = "badge Page"; + + onPageShow() { + console.info('badge page show called'); + } + + onBuildDone() { + console.info('badge page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Badge({ + count: this.counts, + position: BadgePosition.Right, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge') + + Text("BadgePosition.RightTop").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.RightTop, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: '16', badgeSize: '20', badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge1') + + Text("BadgePosition.Left").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.Left, + maxCount: 99, + style: { color: Color.Pink, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge2') + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Blank.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Blank.ets new file mode 100644 index 0000000000000000000000000000000000000000..a50fc719e09ab27c91f9705ac06008e936830f33 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Blank.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct blank_testcase { + @State Color: Color = Color.Pink + @State active: boolean = false + private content: string = "Blank Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Blank(100) + .color(this.Color) + .key('blank') + Text('on/off').fontSize(18).height(60) + } + .key('flex') + .width('100%') + .height('100%') + + + } +} diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Button.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Button.ets new file mode 100644 index 0000000000000000000000000000000000000000..ac2271ea3a13664bbbb6afe4f173abae9e66f867 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Button.ets @@ -0,0 +1,70 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct button_testcase { + @State stateEffect: boolean = true + @State ButtonType: ButtonType = ButtonType.Circle + private content: string = "Button Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button('1.value', { type: ButtonType.Circle, stateEffect: this.stateEffect }) + .fontSize(12) + .fontWeight(FontWeight.Bold) + .fontColor(0xCCCCCC) + .height(40) + .width(40) + .key('button') + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + .padding(10) + Button() { + Text("2.Capsule") + } + .type(ButtonType.Capsule) + .stateEffect(false) + .backgroundColor('#0D9FFB') + .padding(10) + .key('button1') + + Button() { + Text("3.Normal") + }.type(ButtonType.Normal) + .backgroundColor('#0D9FFB') + .key('button2') + + }.key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Column.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Column.ets new file mode 100644 index 0000000000000000000000000000000000000000..b9e5c84e21ccf25419be432d8f95418fac82070a --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Column.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct column { + @State active: boolean = false + private content: string = "Column Page" + + onPageShow() { + console.info('Column page show called'); + } + + onBuildDone() { + console.info('Column page build done called'); + } + + build() { + Column({ space: 5 }) { + Text('alignItems(Center)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Center).width('90%').border({ width: 1 }).key('column') + + Text('alignItems(Start)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column({ space: '5' }) { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Start).width('90%').border({ width: 1 }).key('column1') + + Text('alignItems(End)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.End).width('90%').border({ width: 1 }).key('column2') + }.width('100%').padding({ top: 5 }) + } +} diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets new file mode 100644 index 0000000000000000000000000000000000000000..cb0597310a15be8ab4503a3ae89385e3708fac96 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets @@ -0,0 +1,70 @@ +/* + * 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. + */ + +@Entry +@Component +struct columnSplit { + private content: string = "ColumnSplit Page" + + onPageShow() { + console.info('ColumnSplit page show called'); + } + + onBuildDone() { + console.info('ColumnSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Column() { + Text('ColumnSplit').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit') + .resizeable(true) + .width('90%').height('60%') + + }.width("100%") + + Column() { + Text('ColumnSplit1').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit1') + .resizeable(false) + .width('90%').height('60%') + + }.width("100%") + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Counter.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Counter.ets new file mode 100644 index 0000000000000000000000000000000000000000..ecdbfaf10393e7a348fd76098868e6455505b07f --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Counter.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct counter { + @State value: number = 0 + @State active: boolean = false + private content: string = "Counter Page" + + onPageShow() { + console.info('Counter page show called'); + } + + onBuildDone() { + console.info('Counter page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Counter() { + Text(this.value.toString()) + }.margin(100) + .key('counter') + .onInc(() => { + this.value++ + }) + .onDec(() => { + this.value-- + }) + }.width("100%") + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/DataPanel.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/DataPanel.ets new file mode 100644 index 0000000000000000000000000000000000000000..3c624848482b22998b2a1d137796ddaedbcf198c --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/DataPanel.ets @@ -0,0 +1,69 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct dataPanel_testcase { + @State width: string= "200" + @State height: string= "100" + @State active: boolean = false + private content: string = "DataPanel Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Line }) + .width(this.width) + .height(this.height) + .key('DataPanel') + .onClick(() => { + router.back() + }) + .closeEffect(false) + + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Circle}) + .width(this.width) + .height(this.height) + .key('DataPanel2') + .onClick(() => { + router.back() + }) + .closeEffect(true) + DataPanel({ values: [20, 40, 20], max: 100}) + .width(this.width) + .height(this.height) + .key('DataPanel3') + .onClick(() => { + router.back() + }) + .closeEffect(false) + } + .key('flex') + .width('100%') + .height('100%') + + } +} diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Divider.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Divider.ets new file mode 100644 index 0000000000000000000000000000000000000000..02bf60779418674d1fd58127907fdb3915bd8f8f --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Divider.ets @@ -0,0 +1,71 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct divider_textcase { + @State vertical: boolean = true + @State color: Color = Color.Red + @State strokeWidth: number = 7 + @State lineCap: LineCapStyle = LineCapStyle.Butt + @State active: boolean = false + private content: string = "Divider Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + Divider() + .lineCap(LineCapStyle.Butt) + .strokeWidth(this.strokeWidth) + .color(this.color) + .vertical(this.vertical) + .height(150) + .key('divider') + .onClick(() => { + router.back() + }) + Divider() + .lineCap(LineCapStyle.Round) + .vertical(false) + .color(Color.Green) + .strokeWidth(10) + .height(150) + .key('divider1') + Divider() + .lineCap(LineCapStyle.Square) + .color(Color.Green) + .vertical(true) + .strokeWidth(10) + .height(150) + .key('divider2') + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Flex.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Flex.ets new file mode 100644 index 0000000000000000000000000000000000000000..a0e21251e80008c5be9f29aa52074acc5eb24a78 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Flex.ets @@ -0,0 +1,135 @@ +/* + * 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. + */ + +@Entry +@Component +struct flex { + private content: string = "Flex Page" + + onPageShow() { + console.info('Flex page show called'); + } + + onBuildDone() { + console.info('Flex page build done called'); + } + + build() { + Column() { + Column({ space : 2 }) { + Text('direction:Column').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Column, + wrap: FlexWrap.NoWrap, + justifyContent: FlexAlign.Center, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Start, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:Row').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Row, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.Start, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Center, + }) { + Text('1').width('20%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('20%').height(20).backgroundColor(0xD2B48C) + Text('3').width('20%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex1') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.RowReverse, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.End, + alignItems:ItemAlign.End, + alignContent: FlexAlign.End, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex2') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent:SpaceBetween').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceBetween, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex3') + .height(100) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceEvenly, + alignContent: FlexAlign.SpaceEvenly, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex4') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceAround, + alignContent: FlexAlign.SpaceAround, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex5') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + }.width('100%').margin({ top: 5 }) + }.width('100%') + } +} diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/GridContainer.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/GridContainer.ets new file mode 100644 index 0000000000000000000000000000000000000000..57358110413406263e70a2a5f650cbfeb22a4387 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/GridContainer.ets @@ -0,0 +1,170 @@ +/* + * 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. + */ + +@Entry +@Component +struct gridContainer { + @State sizeType: SizeType = SizeType.XS + @State active: boolean = false + private content: string = "GridContainer Page" + + onPageShow() { + console.info('GridContainer page show called'); + } + + onBuildDone() { + console.info('GridContainer page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll() { + Column({ space: 5 }) { + GridContainer({ columns: 12, sizeType: this.sizeType, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer') + .width('90%') + .alignItems(HorizontalAlign.Start) + + Text('Click Simulate to change the device width').fontSize(9).width('90%').fontColor(0xCCCCCC) + Row() { + Button('XS') + .onClick(() => { + this.sizeType = SizeType.XS + }).backgroundColor(0x317aff) + Button('SM') + .onClick(() => { + this.sizeType = SizeType.SM + }).backgroundColor(0x317aff) + Button('MD') + .onClick(() => { + this.sizeType = SizeType.MD + }).backgroundColor(0x317aff) + Button('LG') + .onClick(() => { + this.sizeType = SizeType.LG + }).backgroundColor(0x317aff) + } + + GridContainer({ columns: "auto", sizeType: SizeType.MD, gutter: '10', margin: '20' }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer1') + .width('90%') + .alignItems(HorizontalAlign.Center) + + GridContainer({ columns: 12, sizeType: SizeType.SM, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer2') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.LG, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer3') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.Auto, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer4') + .width('90%') + .alignItems(HorizontalAlign.End) + + }.width('100%').margin({ top: 5 }) + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Image.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Image.ets new file mode 100644 index 0000000000000000000000000000000000000000..5cc583e931f51aa8e4f2bd55decfeeb14a40afb4 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Image.ets @@ -0,0 +1,90 @@ +/* + * 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. + */ + +@Entry +@Component +struct image_textcase { + @State Width: number = 0 + @State height: number = 0 + + onPageShow() { + console.info('Image page show called'); + } + + onBuildDone() { + console.info('Image page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Image page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Image("/resources/rawfile/hand.png") + .matchTextDirection(false) + .fitOriginalSize(false) + .fillColor(0xCCCCCC) + .objectFit(ImageFit.Cover) + .objectRepeat(ImageRepeat.NoRepeat) + .interpolation(ImageInterpolation.None) + .renderMode(ImageRenderMode.Original) + .autoResize(false) + .syncLoad(false) + .sourceSize({ width: 200, height: 100 }) + .alt("/resources/rawfile/person.png") + .key('image1') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Contain) + .objectRepeat(ImageRepeat.X) + .interpolation(ImageInterpolation.High) + .renderMode(ImageRenderMode.Template) + .key('image2') + .height(180) + .width(180) + .onComplete((msg: { + width: number, + height: number + }) => { + this.Width = msg.width + this.height = msg.height + console.info('Width ----' + this.Width) + console.info('height ----' + this.height) + }) + .onError(() => { + console.info('load image fail') + }) + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Fill) + .objectRepeat(ImageRepeat.Y) + .interpolation(ImageInterpolation.Low) + .key('image3') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.None) + .objectRepeat(ImageRepeat.XY) + .interpolation(ImageInterpolation.Medium) + .key('image4') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.ScaleDown) + .key('image5') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Navigator.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Navigator.ets new file mode 100644 index 0000000000000000000000000000000000000000..6c50769cf2ab045cbe48b52e294b4105a21e1c3d --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Navigator.ets @@ -0,0 +1,60 @@ +/* + * 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. + */ + +@Entry +@Component +struct navigator_testcase { + @State active: boolean = false + @State params: Object = { text: 'news' } + + onPageShow() { + console.info('Navigator page show called'); + } + + onBuildDone() { + console.info('Navigator page build done called'); + } + + build() { + Column() { + Navigator({ target: "pages/index", type: NavigationType.Back }) { + Text('Navigator test in Navigator,back') + }.active(this.active) + .key('navigator') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Push }) { + Text('Navigator test in Navigator,push') + }.active(this.active) + .key('navigator2') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Replace }) { + Text('Navigator test in Navigator,replace') + }.active(this.active) + .key('navigator3') + .params({ + data: 24 + }) + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } +} diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Panel.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Panel.ets new file mode 100644 index 0000000000000000000000000000000000000000..32ddabbd1ccbae3805dd462e6f04b28364d6a1e7 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Panel.ets @@ -0,0 +1,96 @@ +/* + * 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. + */ + +@Entry +@Component +struct PanelExample { + @State show: boolean = true + + onPageShow() { + console.info('Panel page show called'); + } + + onBuildDone() { + console.info('Panel page build done called'); + } + + build() { + Column() { + Text('2021-09-30 Today Calendar: 1.afternoon......Click for details') + .width('90%') + .height(50) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .padding({ left: 20 }) + .onClick(() => { + this.show = !this.show + }) + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel') + .type(PanelType.Foldable) + .mode(PanelMode.Half) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel2') + .type(PanelType.Minibar) + .mode(PanelMode.Mini) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(false) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel3') + .type(PanelType.Temporary) + .mode(PanelMode.Full) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + }.width('100%').height('50%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Progress.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Progress.ets new file mode 100644 index 0000000000000000000000000000000000000000..c8608089fe51e1988fd305fc49db028b6c2efe76 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Progress.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ + +@Entry +@Component +struct progress_testcase { + onPageShow() { + console.info('Progress page show called'); + } + + onBuildDone() { + console.info('Progress page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Progress page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Progress({ value: 20, total: 40, style: ProgressStyle.Linear }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress') + + Progress({ value: 20, total: 40, style: ProgressStyle.Eclipse }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress2') + + Progress({ value: 20, total: 40, style: ProgressStyle.Ring }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress3') + + Progress({ value: 20, total: 40, style: ProgressStyle.ScaleRing }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress4') + + Progress({ value: 20, total: 40, style: ProgressStyle.Capsule }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress5') + + } + .width(400) + .height(400) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Qrcode.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Qrcode.ets new file mode 100644 index 0000000000000000000000000000000000000000..5c0dd84eff5a6653ee5fd940662d141025a1bb4e --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Qrcode.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ + +@Entry +@Component +struct qrcode_textcase { + @State Color: Color = Color.Pink + + onPageShow() { + console.info('Qrcode page show called'); + } + + onBuildDone() { + console.info('Qrcode page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`Qrcode page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + QRCode('hello world') + .color("#FFFFC0CB") + .backgroundColor(this.Color) + .width("200") + .height("100") + .key('qrcode') + } + } +} + + diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Rating.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Rating.ets new file mode 100644 index 0000000000000000000000000000000000000000..b29e26a392fca6f15a5b7f0eb4156dd3bc767c3f --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Rating.ets @@ -0,0 +1,63 @@ +/* + * 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. + */ + +@Entry +@Component +struct rating_testcase { + @State rating: number = 2 + + onPageShow() { + console.info('Rating page show called'); + } + + onBuildDone() { + console.info('Rating page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Rating page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Rating({ rating: 2, indicator: false }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .onChange((value: number) => { + this.rating = value + }) + .key('rating1') + Rating({ rating: 2, indicator: true }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .key('rating2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/RowSplit.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/RowSplit.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f4f397b13b83e98ac643633309b02858f337eb0 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/RowSplit.ets @@ -0,0 +1,78 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct rowSplit_testcase { + @State resizeable: boolean = false + private content: string = "rowSplit Page"; + + onPageShow() { + console.info('RowSplit page show called'); + } + + onBuildDone() { + console.info('RowSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + RowSplit() { + Column() { + Text('Demo1.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo2.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + } + .height(100) + .key('rowSplit') + .resizeable(this.resizeable) + .onClick(() => { + router.back() + }) + + RowSplit() { + Column() { + Text('Demo3.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo4.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + }.height(100) + .key('rowSplit1') + .resizeable(true) + } + .key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Scroll.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Scroll.ets new file mode 100644 index 0000000000000000000000000000000000000000..363089d22580febed16b983d8a4b2877cde52bec --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Scroll.ets @@ -0,0 +1,200 @@ +/* + * 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. + */ + +@Entry +@Component +struct scroll_testcase { + @State scrollBarWidth: number = 20 + @State scrollable: ScrollDirection = ScrollDirection.None + @State scrollBarColor: Color = Color.Pink + @State scrollBar: BarState= BarState.On + private value1: Array = [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30] + @State edge: Edge= Edge.Top + private content: string = "Scroll Page"; + scroller: Scroller = new Scroller(); + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll(this.scroller) { + Column() { + ForEach( + this.value1, + item => { + Text(`${item}`) + .fontSize(15) + .width(400) + .margin(10) + .height(70) + .backgroundColor(0xfff5deb3) + }, + item => item + ) + } + } + .scrollable(ScrollDirection.Vertical) + .scrollBar(this.scrollBar) + .scrollBarColor(this.scrollBarColor) + .scrollBarWidth(this.scrollBarWidth) + .key('scroll') + .width(400) + .height(200) + .onScroll((xOffset: number, yOffset: number) => { + console.info(` current offset is ${xOffset} ${yOffset}`) + }) + .onScrollEnd(() => { + console.info(` now on scroll end`) + }) + .onScrollEdge((side: Edge) => { + console.info(`To the edge`) + }) + Scroll() { + Row() { + Text('scroll uppppp') + .width(60) + .height(100) + .backgroundColor(Color.Yellow) + .margin({ + right: 5, + left: 5 + }) + .key('text') + + Text('scroll to') + .width(60) + .height(100) + .backgroundColor(Color.Green) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollTo({ + xOffset: 100, + yOffset: 100, + }) + }) + Text('scroll page') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollPage({ + next: true + }) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.currentOffset() + }) + Text('scroll to index') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollToIndex(0) + console.info(` now on scroll end`) + }) + } + } + .key('scroll1') + .height(100) + .scrollable(ScrollDirection.Horizontal) + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.None) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll2') + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.Free) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll3') + } + .key('flex') + + } +} diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Slider.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Slider.ets new file mode 100644 index 0000000000000000000000000000000000000000..625cd02874f16e9debb7638322624f890e08fa62 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Slider.ets @@ -0,0 +1,82 @@ +/* + * 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. + */ + +@Entry +@Component +struct slider { + @State inSetValue: number= 40 + @State outSetValue: number= 40 + @State direction: Axis= Axis.Horizontal + @State Begin: number = SliderChangeMode.Begin + + onPageShow() { + console.info('Slider page show called'); + } + + onBuildDone() { + console.info('Slider page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Slider page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Slider({ + value: this.outSetValue, + min: 0, + max: 100, + step: 1, + direction: Axis.Horizontal, + reverse: false, + style: SliderStyle.OutSet + }) + .blockColor('#FFFF0000') + .selectedColor('#FF0000FF') + .trackColor('#FF808080') + .minLabel('10') + .maxLabel('10') + .showTips(false) + .showSteps(false) + .onChange((value: number, mode: SliderChangeMode) => { + this.outSetValue = value + this.Begin = mode + console.info('value: ' + value + '---mode: ' + mode) + }) + .width("100") + .height("100") + .key('slider1') + Slider({ + value: 40, + min: 0, + max: 100, + step: 1, + style: SliderStyle.InSet + }) + .blockColor(Color.Red) + .selectedColor(Color.Blue) + .trackColor(Color.Gray) + .showTips(true) + .showSteps(true) + .key('slider2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Span.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Span.ets new file mode 100644 index 0000000000000000000000000000000000000000..df5a71043f1ae000b822646f6b56df7ae103fa1f --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Span.ets @@ -0,0 +1,64 @@ +/* + * 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. + */ + +@Entry +@Component +struct span_textcase { + + onPageShow() { + console.info('Span page show called'); + } + + onBuildDone() { + console.info('Span page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text() { + Span('Test Span demo') + .decoration({ type: TextDecorationType.LineThrough, "color": Color.Red }) + .textCase(TextCase.UpperCase) + .fontColor(Color.Blue) + .fontSize("20fp") + .letterSpacing(5) + .fontFamily("sans-serif") + .fontWeight(FontWeight.Bold) + .fontStyle(FontStyle.Italic) + .key('span1') + Span('The second test Span demo') + .textCase(TextCase.LowerCase) + .fontColor(Color.Black) + .letterSpacing('5') + .fontSize(30) + .key('span2') + Span('The third test Span demo') + .textCase(TextCase.Normal) + .fontColor(Color.Yellow) + .fontSize("30fp") + .key('span3') + } + } + .width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + + diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Stack.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Stack.ets new file mode 100644 index 0000000000000000000000000000000000000000..2a694889f0e768afbd3e3af6a17c3af9d8738cfb --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Stack.ets @@ -0,0 +1,103 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct stack_testcase { + @State alignContent: Alignment = Alignment.Bottom + private content: string = "Stack Page"; + + onPageShow() { + console.info('Stack page show called'); + } + + onBuildDone() { + console.info('Stack page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Stack({ alignContent: this.alignContent }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + } + .width('100%') + .height(80) + .margin({ top: 5 }) + .key('stack') + .onClick(() => { + router.back() + }) + + Stack({ alignContent: Alignment.BottomStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack1') + + Stack({ alignContent: Alignment.BottomEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack2') + + Stack({ alignContent: Alignment.Start }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack3') + + Stack({ alignContent: Alignment.Center }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack4') + + Stack({ alignContent: Alignment.End }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack5') + + Stack({ alignContent: Alignment.Top }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack6') + + Stack({ alignContent: Alignment.TopStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack7') + + Stack({ alignContent: Alignment.TopEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack8') + } + .key('flex') + .width('100%') + .height('100%') + + } +} + diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Text.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Text.ets new file mode 100644 index 0000000000000000000000000000000000000000..fbd1415dc815b0f1966476c430f7d69e28e587ee --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/Text.ets @@ -0,0 +1,237 @@ +/* + * 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. + */ + +// @ts-nocheck +import router from '@system.router' + +var paramInfo = router.getParams() +console.info("cd paramInfo" + JSON.stringify(paramInfo)) + +@Entry +@Component +struct text_textcase { + @State textAlign: TextAlign= TextAlign.End + @State lineHeight: string= '15fp' + @State overflow: TextOverflow = TextOverflow.Ellipsis + @State textOverflow: textOverflow<{ "overflow": TextOverflow }> = { "overflow": this.overflow } + @State maxLines: number = 2 + @State baselineOffset: number = 0 + @State textCase: TextCase= TextCase.Normal + @State decoration: decoration<{ + type: TextDecorationType, + color: Color + }> = { type: TextDecorationType.Underline, color: Color.Red } + @State color: Color = Color.Red + @State width: string= "200" + @State height: string= "100" + @State size: size = { width: 200, height: 100 } + @State marginBottom: string = "10px" + @State marginTop: string = "10px" + @State marginLeft: string = "10px" + @State marginRingt: string= "10px" + @State paddingBottom: string= "5" + @State paddingTop: string= "5" + @State paddingLeft: string= "5" + @State paddingRingt: string= "5" + @State constraintSize: constraintSize = { minWidth: 20, maxWidth: 200, minHeight: 0, maxHeight: 50 } + @State layoutPriority: string= "9px" + @State layoutWeight: string = "10px" + @State align: Alignment = Alignment.Center + @State direction: Direction = Direction.Auto + @State position: position<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State markAnchor: markAnchor<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State offset: offset<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State flexGrow: number = 5 + @State flexShrink: number = 2 + @State flexBasis: number = 0 + @State alignSelf: ItemAlign = ItemAlign.Auto + @State borderStyle: BorderStyle = BorderStyle.Dashed + @State borderRadius: number = 10 + @State borderWidth: string= "4px" + @State borderColor: Color= Color.Blue + @State backgroundColor: Color = Color.Pink + @State backgroundImageSize: ImageSize = ImageSize.Cover + @State backgroundImagePosition: Alignment= Alignment.Center + @State opacity: number= 1 + @State visibility: Visibility= Visibility.Visible + @State enabled: boolean = false + @State zIndex: number = 1 + @State fontStyle: FontStyle = FontStyle.Italic + @State fontSize: number = 15 + @State minFontSize: number = 15 + @State maxFontSize: number = 15 + @State letterSpacing: number= 10 + @State fontWeight: FontWeight= FontWeight.Bold + @State fontColor: Color= Color.Black + @State active: boolean = false + private content: string = "Text Page"; + + onPageShow() { + console.info('Text page show called'); + } + + onBuildDone() { + console.info('Text page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .width(this.width) + .height(this.height) + .padding({ bottom: this.paddingBottom, top: this.paddingTop, right: this.paddingRingt, left: this.paddingLeft }) + .margin({ bottom: this.marginBottom, top: this.marginTop, right: this.marginRingt, left: this.marginLeft }) + .constraintSize(this.constraintSize) + .layoutWeight(this.layoutWeight) + .align(this.align) + .direction(this.direction) + .position(this.position) + .markAnchor(this.markAnchor) + .offset(this.offset) + .flexBasis(this.flexBasis) + .flexGrow(this.flexGrow) + .flexShrink(this.flexShrink) + .alignSelf(this.alignSelf) + .borderStyle(this.borderStyle) + .borderRadius(this.borderRadius) + .borderWidth(this.borderWidth) + .borderColor(this.borderColor) + .backgroundColor(this.backgroundColor) + .opacity(this.opacity) + .visibility(this.visibility) + .enabled(this.enabled) + .zIndex(this.zIndex) + .fontColor(this.fontColor) + .fontSize(this.fontSize) + .minFontSize(this.minFontSize) + .letterSpacing(this.letterSpacing) + .maxFontSize(this.maxFontSize) + .fontWeight(this.fontWeight) + .fontStyle(this.fontStyle) + .fontFamily("sans-serif") + .textAlign(this.textAlign) + .textOverflow(this.textOverflow) + .lineHeight(this.lineHeight) + .baselineOffset(this.baselineOffset) + .maxLines(2) + .textCase(this.textCase) + .decoration(this.decoration) + .aspectRatio(1) + .fontColor(Color.Black) + .key('Text') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .size({ width: 100, height: 50 }) + .padding({ bottom: 5, top: 5, right: 5, left: 10 }) + .margin({ bottom: 15, top: 10, right: 10, left: 10 }) + .fontSize('13') + .textAlign(TextAlign.Start) + .align(Alignment.Start) + .direction(Direction.Ltr) + .alignSelf(ItemAlign.Start) + .borderStyle(BorderStyle.Dotted) + .borderWidth(2) + .visibility(Visibility.Hidden) + .enabled(true) + .fontWeight(FontWeight.Normal) + .textAlign(TextAlign.Start) + .textOverflow(TextOverflow.Clip) + .maxLines(2) + .textCase(TextCase.LowerCase) + .decoration({ "type": TextDecorationType.LineThrough, "color": Color.Red }) + .fontColor(Color.White) + .key('Text1') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .width('100%') + .textAlign(TextAlign.Center) + .align(Alignment.TopEnd) + .direction(Direction.Rtl) + .alignSelf(ItemAlign.Center) + .borderStyle(BorderStyle.Solid) + .borderWidth(2) + .visibility(Visibility.None) + .fontWeight(FontWeight.Bolder) + .textAlign(TextAlign.Center) + .textOverflow(TextOverflow.None) + .textCase(TextCase.UpperCase) + .decoration({ "type": TextDecorationType.None, "color": Color.Red }) + .fontColor(Color.Blue) + .key('Text2') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Top) + .alignSelf(ItemAlign.End) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Lighter) + .decoration({ type: TextDecorationType.Overline, color: Color.Red }) + .fontColor(Color.Gray) + .key('Text3') + Text('Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.TopStart) + .alignSelf(ItemAlign.Baseline) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Medium) + .fontColor(Color.Brown) + .key('Text4') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.End) + .alignSelf(ItemAlign.Stretch) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Regular) + .fontColor(Color.Grey) + .key('Text5') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomEnd) + .width('100%') + .fontColor(Color.Orange) + .key('Text6') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Bottom) + .width('100%') + .fontColor(Color.Yellow) + .key('Text7') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomStart) + .width('100%') + .key('Text8') + + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/index.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..10359134da915c9b44b0836ba4881bca71f43f33 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,65 @@ +// @ts-nocheck +/** + * 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 file from '@system.file'; + +import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets"; +import testsuite from "../test/List.test.ets"; +import featureAbility from "@ohos.ability.featureAbility"; + +@Entry +@Component +struct MyComponent { + aboutToAppear() { + console.info("start run testcase!!!!") + featureAbility.getWant() + .then((Want) => { + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + Want.parameters['timeout'] = 100000 + console.info('parameters---->' + JSON.stringify(Want.parameters)); + configService.setConfig(Want.parameters); + testsuite(); + core.execute(); + console.info('Operation successful. Data: ' + JSON.stringify(Want)); + }) + .catch((error) => { + console.error('Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('ACE ETS TEST') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/CallJsunit.test.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/CallJsunit.test.ets similarity index 61% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/CallJsunit.test.ets rename to telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/CallJsunit.test.ets index 744b261c0f27b7de980d7feda1e1f19d3f0ed25c..0cd2dcefec69a88f98c4afbffed06f668efefc04 100644 --- a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/CallJsunit.test.ets +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/CallJsunit.test.ets @@ -44,98 +44,6 @@ export default function callJsunit(){ describe('callTest', function(){ console.log("==========> call Test start ==========>"); - /** - * @tc.number Telephony_Call_Call_Dial_0100 - * @tc.name Makes a call. - * @tc.desc Function test - */ - it("Telephony_Call_Call_Dial_0100",0,async function(done){ - let caseName:string = "Telephony_Call_Call_Dial_0100"; - console.log(`==========> ${caseName} Test start ==========>`); - call.dial(PHONE_NUMBER,(err,data) => { - if(err){ - console.log(`${caseName} error,case success,error:${toString(err)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} success,case fail`); - done(); - }); - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); - - /** - * @tc.number Telephony_Call_Call_Dial_0200 - * @tc.name Makes a call. - * @tc.desc Function test - */ - it("Telephony_Call_Call_Dial_0200",0,async function(done){ - let caseName:string = "Telephony_Call_Call_Dial_0200"; - console.log(`==========> ${caseName} Test start ==========>`); - let options = {extras:false, accountId:DEFAULT_SLOT_ID, videoState:MEDIA_TYPE_VOICE, - dialScene:DIAL_SCENCE_CALL_PRIVILEGED, dialType:DIAL_CARRIER_TYPE}; - call.dial(PHONE_NUMBER,options,(err,data) => { - if(err){ - console.log(`${caseName} error,case success,error:${toString(err)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} success,case fail`); - done(); - }); - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); - - /** - * @tc.number Telephony_Call_Call_Dial_0200 - * @tc.name Makes a call. - * @tc.desc Function test - */ - it("Telephony_Call_Call_Dial_0200",0,async function(done){ - let caseName:string = "Telephony_Call_Call_Dial_0200"; - console.log(`==========> ${caseName} Test start ==========>`); - let options = {extras:false, accountId:DEFAULT_SLOT_ID, videoState:MEDIA_TYPE_VOICE, - dialScene:DIAL_SCENCE_CALL_PRIVILEGED, dialType:DIAL_CARRIER_TYPE}; - call.dial(PHONE_NUMBER,options,(err,data) => { - if(err){ - console.log(`${caseName} error,case success,error:${toString(err)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} success,case fail`); - done(); - }); - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); - - - - /** - * @tc.number Telephony_Call_Call_Dial_0300 - * @tc.name Makes a call. - * @tc.desc Function test - */ - it("Telephony_Call_Call_Dial_0300",0,async function(done){ - let caseName:string = "Telephony_Call_Call_Dial_0300"; - console.log(`==========> ${caseName} Test start ==========>`); - let options = {extras:false, accountId:DEFAULT_SLOT_ID, videoState:MEDIA_TYPE_VOICE, - dialScene:DIAL_SCENCE_CALL_PRIVILEGED, dialType:DIAL_CARRIER_TYPE}; - call.dial(PHONE_NUMBER,options).then(data=>{ - expect(true).assertTrue(); - }).catch(error =>{ - console.log(caseName+ " dial error :"+ toString(error)); - done(); - return; - }); - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); /** * @tc.number Telephony_Call_Call_MakeCall_0100 @@ -215,243 +123,7 @@ export default function callJsunit(){ done(); }); - /** - * @tc.number Telephony_Call_Call_Reject_0100 - * @tc.name call_reject - * @tc.desc Function test - */ - it("Telephony_Call_Call_Reject_0100",0,async function(done){ - let caseName = 'Telephony_Call_Call_Reject_0100'; - console.log(`==========> ${caseName} Test start ==========>`); - call.reject(BOUNDARY_NUMBER_INT, (error) => { - if (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} success,case failed`); - done(); - }); - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); - - /** - * @tc.number Telephony_Call_Call_Reject_0200 - * @tc.name call_reject - * @tc.desc Function test - */ - it("Telephony_Call_Call_Reject_0200",0,async function(done){ - let caseName = 'Telephony_Call_Call_Reject_0200'; - console.log(`==========> ${caseName} Test start ==========>`); - let options = {messageContent:"hello"} - call.reject(BOUNDARY_NUMBER_INT,options, (error) => { - if (error) { - console.log(`${caseName} error,case success,error:${toString(error)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} success,case failed`); - done(); - }); - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); - - /** - * @tc.number Telephony_Call_Call_Reject_0300 - * @tc.name call_reject - * @tc.desc Function test - */ - it("Telephony_Call_Call_Reject_0300",0,async function(done){ - let caseName = 'Telephony_Call_Call_Reject_0300'; - console.log(`==========> ${caseName} Test start ==========>`); - call.reject(CALL_ID_NOT_EXIST).then(() => { - expect().assertFail(); - console.log(`${caseName} success,case failed`); - done(); - }).catch(error => { - console.log(`${caseName} error,case success,error:${toString(error)}`); - done(); - return; - }); - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); - - /** - * @tc.number Telephony_Call_On_CallDetailsChange_0100 - * @tc.name Method in call_on of type callDetailsChange - * @tc.desc Function test - */ - it("Telephony_Call_On_CallDetailsChange_0100",0,async function(done){ - let caseName:string = "Telephony_Call_On_CallDetailsChange_0100"; - console.log(`==========> ${caseName} Test start ==========>`); - try{ - call.on("callDetailsChange",(err,data) => { - if(err){ - console.log(`${caseName} error,error :${toString(err)}`); - done(); - return; - } else { - let callAttributeOptions = data; - console.log(`${caseName} success, startTime = :` + callAttributeOptions.startTime); - } - expect(true).assertTrue(); - done(); - }); - done(); - }catch(err){ - expect().assertFail(); - console.log(`${caseName} fail, err:${err}`); - done(); - } - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); - - /** - * @tc.number Telephony_Call_Off_callDetailsChange_0100 - * @tc.name Method in call_off of type callDetailsChange - * @tc.desc Function test - */ - it("Telephony_Call_Off_CallDetailsChange_0100",0,async function(done){ - let caseName:string = "Telephony_Call_Off_CallDetailsChange_0100"; - console.log(`==========> ${caseName} Test start ==========>`); - try{ - call.off("callDetailsChange",(err,data) => { - if(err){ - console.log(`${caseName} error,error :${toString(err)}`); - done(); - return; - } - expect(true).assertTrue(); - done(); - }); - done(); - }catch(err){ - expect().assertFail(); - console.log(`${caseName} fail, err:${err}`); - done(); - } - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); - - /** - * @tc.number Telephony_Call_On_CallEventChange_0200 - * @tc.name Method in call_on of type callEventChange - * @tc.desc Function test - */ - it("Telephony_Call_On_CallEventChange_0200",0,async function(done){ - let caseName:string = "Telephony_Call_On_CallEventChange_0200"; - console.log(`==========> ${caseName} Test start ==========>`); - try{ - call.on("callEventChange",(err,data) => { - if(err){ - console.log(`${caseName} error,error :${toString(err)}`); - done(); - return; - } - expect(true).assertTrue(); - done(); - }); - done(); - }catch(err){ - expect().assertFail(); - console.log(`${caseName} fail, err:${err}`); - done(); - } - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); - - /** - * @tc.number Telephony_Call_Off_CallEventChange_0200 - * @tc.name Method in call_off of type callEventChange - * @tc.desc Function test - */ - it("Telephony_Call_Off_CallEventChange_0200",0,async function(done){ - let caseName:string = "Telephony_Call_Off_CallEventChange_0200"; - console.log(`==========> ${caseName} Test start ==========>`); - try{ - call.off("callEventChange",(err,data) => { - if(err){ - console.log(`${caseName} error,error :${toString(err)}`); - done(); - return; - } - expect(true).assertTrue(); - done(); - }); - done(); - }catch(err){ - expect().assertFail(); - console.log(`${caseName} fail, err:${err}`); - done(); - } - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); - - /** - * @tc.number Telephony_Call_Off_CallEventChange_0200 - * @tc.name Method in call_off of type callDisconnectedCause - * @tc.desc Function test - */ - it("Telephony_Call_On_CallDisconnectedCause_0300",0,async function(done){ - let caseName:string = "Telephony_Call_On_CallDisconnectedCause_0300"; - console.log(`==========> ${caseName} Test start ==========>`); - try{ - call.on("callDisconnectedCause",(err,data) => { - if(err){ - console.log(`${caseName} error,error :${toString(err)}`); - done(); - return; - } - expect(true).assertTrue(); - done(); - }); - done(); - }catch(err){ - expect().assertFail(); - console.log(`${caseName} fail, err:${err}`); - done(); - } - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); - - /** - * @tc.number Telephony_Call_Off_CallEventChange_0200 - * @tc.name Method in call_off of type callDisconnectedCause - * @tc.desc Function test - */ - it("Telephony_Call_Off_CallDisconnectedCause_0300",0,async function(done){ - let caseName:string = "Telephony_Call_Off_CallDisconnectedCause_0300"; - console.log(`==========> ${caseName} Test start ==========>`); - try{ - call.off("callDisconnectedCause",(err,data) => { - if(err){ - console.log(`${caseName} error,error :${toString(err)}`); - done(); - return; - } - expect(true).assertTrue(); - done(); - }); - done(); - }catch(err){ - expect().assertFail(); - console.log(`${caseName} fail, err:${err}`); - done(); - } - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); - + /** * @tc.number Telephony_Call_AudioDevice_DEVICE_MIC * @tc.name Enum AudioDevice @@ -470,30 +142,7 @@ export default function callJsunit(){ done(); }); - /** - * @tc.number Telephony_Call_Dial_Dial_0200 - * @tc.name Makes a call. - * @tc.desc Function test - */ - it("Telephony_Call_DialOptions_Extras",0,async function(done){ - let caseName:string = "Telephony_Call_DialOptions_extras"; - console.log(`==========> ${caseName} Test start ==========>`); - let options = {extras:false, accountId:DEFAULT_SLOT_ID, videoState:MEDIA_TYPE_VOICE, - dialScene:DIAL_SCENCE_CALL_PRIVILEGED, dialType:DIAL_CARRIER_TYPE}; - call.dial(PHONE_NUMBER,options,(err,data) => { - if(err){ - console.log(`${caseName} error,case success,error:${toString(err)}`); - done(); - return; - } - expect().assertFail(); - console.log(`${caseName} success,case fail`); - done(); - }); - console.log(`==========> ${caseName} Test end ==========>`); - done(); - }); - + /** * @tc.number Telephony_Call_CallTransferType_TRANSFER_TYPE_BUSY * @tc.name Enum CallTransferType @@ -850,4 +499,5 @@ export default function callJsunit(){ }); -} \ No newline at end of file +} + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/ConvertOptionsJsunit.test.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/ConvertOptionsJsunit.test.ets similarity index 88% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/ConvertOptionsJsunit.test.ets rename to telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/ConvertOptionsJsunit.test.ets index 95fd59ba442e4b3faba4f798b3bed278fdaa5eeb..c03aae67d2963ec8f15d17825e19662379f0ade6 100644 --- a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/ConvertOptionsJsunit.test.ets +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/ConvertOptionsJsunit.test.ets @@ -15,7 +15,7 @@ */ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -import ConvertXML from '@ohos.convertxml' +import convertxml from '@ohos.convertxml' export default function convertOptionsJsunit() { describe('XmlTest',function () { console.log("************* settings Test start*************"); @@ -27,8 +27,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false,trim :true}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false,trim :true})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -59,8 +59,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreDeclaration: true}); + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, ignoreDeclaration: true})); var str1 = '{"_elements":[{"_type":"element",'+ '"_name":"note",'+ '"_attributes":{"importance":"high",'+ @@ -89,8 +89,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreDeclaration: true}); + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, ignoreDeclaration: true})); var str1 = '{"_elements":[{"_type":"element",'+ '"_name":"note",'+ '"_attributes":{"importance":"high",'+ @@ -119,8 +119,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreAttributes: true}); + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, ignoreAttributes: true})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -150,8 +150,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreComment: true}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, ignoreComment: true})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -183,8 +183,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreCDATA: true}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, ignoreCDATA: true})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -216,8 +216,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreDoctype: true}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, ignoreDoctype: true})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -248,8 +248,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreText: true}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, ignoreText: true})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -274,8 +274,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, declarationKey: "123"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, declarationKey: "123"})); var str1 = '{"123":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -307,8 +307,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, instructionKey: "123"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, instructionKey: "123"})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -343,8 +343,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, attributesKey: "123"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, attributesKey: "123"})); var str1 = '{"_declaration":{"123":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"123":{"importance":"high",'+ @@ -378,8 +378,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, textKey: "123"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, textKey: "123"})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -411,8 +411,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, cdataKey: "123"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, cdataKey: "123"})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -446,8 +446,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, doctypeKey: 'doctype'}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, doctypeKey: 'doctype'})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"doctype","doctype":"foo"},'+ @@ -480,8 +480,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, commentKey: "123"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, commentKey: "123"})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"123":"note",'+ @@ -515,8 +515,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, parentKey: "123"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, parentKey: "123"})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -551,8 +551,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, typeKey: "123"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, typeKey: "123"})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"123":"element",'+ @@ -583,8 +583,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, nameKey: "123"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, nameKey: "123"})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"123":"note",'+ @@ -615,8 +615,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, elementsKey: "123"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, elementsKey: "123"})); var str1 = '{"123":[{"123":[{"123":[{"_type":"text",'+ '"_text":"Happy"}],'+ '"_type":"element",'+ @@ -647,8 +647,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false,trim :true}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false,trim :true})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -679,8 +679,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreDeclaration: true}); + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, ignoreDeclaration: true})); var str1 = '{"_elements":[{"_type":"element",'+ '"_name":"note",'+ '"_attributes":{"importance":"high",'+ @@ -709,8 +709,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreDeclaration: true}); + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, ignoreDeclaration: true})); var str1 = '{"_elements":[{"_type":"element",'+ '"_name":"note",'+ '"_attributes":{"importance":"high",'+ @@ -739,8 +739,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreAttributes: true}); + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, ignoreAttributes: true})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -770,8 +770,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreComment: true}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, ignoreComment: true})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -803,8 +803,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreCDATA: true}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, ignoreCDATA: true})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -836,8 +836,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreDoctype: true}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, ignoreDoctype: true})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -868,8 +868,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreText: true}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, ignoreText: true})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -894,8 +894,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, declarationKey: "456"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, declarationKey: "456"})); var str1 = '{"456":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -927,8 +927,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, instructionKey: "456"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, instructionKey: "456"})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -963,8 +963,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, attributesKey: "456"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, attributesKey: "456"})); var str1 = '{"_declaration":{"456":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"456":{"importance":"high",'+ @@ -998,8 +998,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, textKey: "456"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, textKey: "456"})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -1031,8 +1031,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, cdataKey: "456"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, cdataKey: "456"})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -1066,8 +1066,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, doctypeKey: 'doctype_next'}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, doctypeKey: 'doctype_next'})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"doctype","doctype_next":"foo"},'+ @@ -1100,8 +1100,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, commentKey: "456"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, commentKey: "456"})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"456":"note",'+ @@ -1135,8 +1135,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, parentKey: "456"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, parentKey: "456"})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ @@ -1171,8 +1171,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, typeKey: "123"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, typeKey: "123"})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"123":"element",'+ @@ -1203,8 +1203,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, nameKey: "123"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, nameKey: "123"})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"123":"note",'+ @@ -1235,8 +1235,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, elementsKey: "123"}) + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, elementsKey: "123"})); var str1 = '{"123":[{"123":[{"123":[{"_type":"text",'+ '"_text":"Happy"}],'+ '"_type":"element",'+ @@ -1273,8 +1273,8 @@ export default function convertOptionsJsunit() { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreInstruction: true}); + var conv = new convertxml.ConvertXML(); + var result1 = JSON.stringify(conv.convert(xml, {compact: false, ignoreInstruction: true})); var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/DataJsunit.test.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/DataJsunit.test.ets similarity index 100% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/DataJsunit.test.ets rename to telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/DataJsunit.test.ets diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/List.test.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/List.test.ets similarity index 89% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/List.test.ets rename to telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/List.test.ets index 5ebbc36cbeebfd745bd354e169e3664b4de948b0..65091fa54744a8ea754df0e1294dcc7cd809e201 100644 --- a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/List.test.ets +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/List.test.ets @@ -17,11 +17,9 @@ import convertOptionsJsunit from './ConvertOptionsJsunit.test.ets' import radioJsunit from './RadioJsunit.test.ets' import radioSecondJsunit from './RadioSecondJsunit.test.ets' -import observerJsunit from './ObserverJsunit.test.ets' import smsUiJsunit from './SmsMmsJsunit.test.ets'; import callJsunit from './CallJsunit.test.ets'; import dataJsunit from './DataJsunit.test.ets'; -import simJsunit from './SimJsunit.test.ets'; import statisticsUiJsunit from './StatisticsJsunit.test.ets'; export default function testsuite() { @@ -30,9 +28,7 @@ export default function testsuite() { callJsunit(); smsUiJsunit(); convertOptionsJsunit(); - observerJsunit(); radioJsunit(); radioSecondJsunit(); - simJsunit(); statisticsUiJsunit(); } \ No newline at end of file diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/RadioJsunit.test.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/RadioJsunit.test.ets similarity index 76% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/RadioJsunit.test.ets rename to telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/RadioJsunit.test.ets index a6222c0256ae4c37fd270abb3186d252443a3480..bcff586cef6c1fd00ae902a052be651364d70fab 100644 --- a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/RadioJsunit.test.ets +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/RadioJsunit.test.ets @@ -24,49 +24,7 @@ export default function radioJsunit() { const SLOT_2 = -1; const SLOT_0 = 0; - /** - * @tc.number Telephony_NetworkSearch_getMEID_Async_0100 - * @tc.name Test getMEID(-1) to view the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_getMEID_Async_0100', 0, async function (done) { - if(utils.notCheck){ - done(); - return; - } - radio.getMEID(SLOT_2, (err, data) => { - if (err) { - console.log(`Telephony_NetworkSearch_getMEID_Async_0100 fail: ${err}`); - expect().assertFail(); - done(); - return; - } - console.log(`Telephony_NetworkSearch_getMEID_Async_0100 end data: ${data}`); - expect(data === '').assertTrue(); - done(); - }); - }); - - /** - * @tc.number Telephony_NetworkSearch_getMEID_Promise_0100 - * @tc.name Test getMEID(-1) to check the callback result - * @tc.desc FunctigetMEIDon test - */ - it('Telephony_NetworkSearch_getMEID_Promise_0100', 0, async function (done) { - if(utils.notCheck){ - done(); - return; - } - radio.getMEID(SLOT_2).then(data => { - console.log(`Telephony_NetworkSearch_getMEID_Promise_0100 end data: ${data}`); - expect(data === '').assertTrue(); - done(); - }).catch(err => { - console.log(`Telephony_NetworkSearch_getMEID_Promise_0100 fail: ${err}`); - expect().assertFail(); - done(); - }) - }); + /** * @tc.number Telephony_NetworkSearch_getPrimarySlotId_Async_0200 @@ -91,49 +49,7 @@ export default function radioJsunit() { }); }); - /** - * @tc.number Telephony_NetworkSearch_setPrimarySlotId_Async_0300 - * @tc.name Test The function setPrimarySlotId(0) - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_setPrimarySlotId_Async_0300', 0, async function (done) { - if(utils.notCheck){ - done(); - return; - } - radio.setPrimarySlotId(SLOT_0, (err, data) => { - if (err) { - console.log(`Telephony_NetworkSearch_setPrimarySlotId_Async_0300 fail: ${err}`); - expect(data === undefined).assertTrue(); - done(); - return; - } - console.log(`Telephony_NetworkSearch_setPrimarySlotId_Async_0300 end data: ${data}`); - expect(data === '').assertTrue(); - done(); - }); - }); - - /** - * @tc.number Telephony_NetworkSearch_setPrimarySlotId_Async_0300 - * @tc.name Test The function setPrimarySlotId(0) - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_setPrimarySlotId_Promise_0300', 0, async function (done) { - if(utils.notCheck){ - done(); - return; - } - try { - await radio.setPrimarySlotId(SLOT_0); - console.log('Telephony_NetworkSearch_setPrimarySlotId_Promise_0300 success'); - done(); - } catch (err) { - console.log(`Telephony_NetworkSearch_setPrimarySlotId_Promiss_0300 fail ${err}`); - done(); - } - }); - + /** * @tc.number Telephony_NetworkSearch_isNrSupported_Promise_0400 * @tc.name Test The function setPrimarySlotId(0) diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/RadioSecondJsunit.test.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/RadioSecondJsunit.test.ets similarity index 68% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/RadioSecondJsunit.test.ets rename to telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/RadioSecondJsunit.test.ets index c4a9207ba62ee1ebc996590591d209abeebc4c26..3ae50bb8dc46b6ee1f6309cb6055612420a6eb3e 100644 --- a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/RadioSecondJsunit.test.ets +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/RadioSecondJsunit.test.ets @@ -65,63 +65,9 @@ export default function radioSecondJsunit() { const CELL_INFO_MIN = 0; const TIME_RADIO_TURNON = 10000; console.log("************* radio Test start*************"); - it('Telephony_NetworkSearch_getCellInformation_Async_0100', 0, async function (done) { - if (utils.notCheck) { - expect(true).assertTrue(); - done(); - return; - } - radio.getCellInformation((err, data) => { - if (err) { - console.log(`Telephony_NetworkSearch_getCellInformation_Async_0100 fail: ${err}`); - expect().assertFail(); - done(); - return; - } - console.log(`Telephony_NetworkSearch_getCellInformation_Async_0100 end data: ${JSON.stringify(data)}`); - if (true) { - console.log(`Telephony_NetworkSearch_getCellInformation_Async_0100 1`); - expect(true).assertTrue(); - done(); - return; - } else { - assertCellInformation(data); - done(); - } - }); - }); - - /** - * @tc.number Telephony_NetworkSearch_getNrOptionMode_Async_0100 - * @tc.name Test getNrOptionMode() to check the callback result - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_getNrOptionMode_Async_0100', 0, async function (done) { - if (utils.notCheck) { - expect(true).assertTrue(); - done(); - return; - } - radio.getNrOptionMode((err, data) => { - if (err) { - console.log(`Telephony_NetworkSearch_getNrOptionMode_Async_0100 get fail err: ${err}`); - expect().assertFail(); - done(); - return; - } - console.log(`Telephony_NetworkSearch_getNrOptionMode_Async_0100 end data: ${JSON.stringify(data)}`); - if (true) { - console.log(`Telephony_NetworkSearch_getNrOptionMode_Async_0100 1`); - expect(true).assertTrue(); - done(); - return; - } else { - expect(NROPTION_MODE).assertContain(data); - done(); - } - }); - }) + + /** * @tc.number Telephony_NetworkSearch_NetworkState_Async_0100 * @tc.name Test getNrOptionMode() to check the callback result @@ -179,52 +125,7 @@ export default function radioSecondJsunit() { }) - /** - * @tc.number Telephony_NetworkSearch_getNetworkSearchInformation_Async_0100 - * @tc.name Test the getNetworkSearchInformation() query function and set the slotId parameter input to 0, - * test the return value isNetworkSearchSuccess is true and specific operator information - * @tc.desc Function test - */ - it('Telephony_NetworkSearch_getNetworkSearchInformation_Async_0100', 0, async function (done) { - if (utils.notCheck) { - expect(true).assertTrue(); - done(); - return; - } - radio.getNetworkSearchInformation(SLOT_0, (err, data) => { - if (err) { - console.log(`Telephony_NetworkSearch_getNetworkSearchInformation_Async_0100 fail err: ${err}`); - expect().assertFail(); - done(); - return; - } - if (true){ - console.log(`Telephony_NetworkSearch_getNetworkSearchInformation_Async_0100 1`); - expect(true).assertTrue(); - done(); - return; - } - expect(data != null && data != undefined).assertTrue(); - if (data.networkSearchResult.length === 0) { - console.log('Telephony_NetworkSearch_getNetworkSearchInformation_Async_0100 fail'); - expect().assertFail(); - done(); - return; - } - console.log( - `Telephony_NetworkSearch_getNetworkSearchInformation_Async_0100 finish data: ${JSON.stringify(data)}`); - expect(data.isNetworkSearchSuccess).assertTrue(); - expect( - data.networkSearchResult[0].operatorName != undefined && - data.networkSearchResult[0].operatorName != '' && - data.networkSearchResult[0].operatorName != null - ).assertTrue(); - expect(garrNetworkState).assertContain(data.networkSearchResult[0].state); - expect(garrNetworkRadioTech).assertContain(data.networkSearchResult[0].radioTech); - expect(data.networkSearchResult[0].operatorNumeric.substr(0, 3) === '460').assertTrue(); - done(); - }); - }); + console.log("************* radio Test end*************"); function assertCellInformation(data) { expect(data !== '' && data != undefined && data != null).assertTrue(); diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/SmsMmsJsunit.test.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/SmsMmsJsunit.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..52217aac4fef419488eb4d2d2f4e8b35300d6cef --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/SmsMmsJsunit.test.ets @@ -0,0 +1,160 @@ +// @ts-nocheck +/** + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets"; +import mms from '@ohos.telephony.sms'; +import utils from './Utils.ets' +export default function smsUiJsunit() { + describe('appInfoTest', function () { + + const SMS_SEND_DST_NUMBER = ''; + const TRUE_SLOT_ID = 0; + const FALSE_SLOT_ID = 9; + const OTHER_SLOT_ID = 1; + const SECOND_SLOT_ID = 2; + const IDENTIFIER_MIN = 0; + const IDENTIFIER_MAX = 0xFFFF; + const RANTYPE_GSM = 1; + const RANTYPE_CDMA = 2; + const RANTYPE_ERROR = 3; + var rawArray = [ + 0x08, 0x91, 0x68, 0x31, 0x08, 0x20, 0x00, 0x75, 0xF4, 0x24, 0x0D, 0x91, + 0x68, 0x81, 0x29, 0x56, 0x29, 0x83, 0xF6, 0x00, 0x00, 0x12, 0x40, 0x80, + 0x01, 0x02, 0x14, 0x23, 0x02, 0xC1, 0x30 + ] + + + + /* + * @tc.number Telephony_SmsMms_createMessage_Async_0100 + * @tc.name Call interface CreateMessage, + * pass in the PDU(rawArray) in line with the coding specification, the specification is 3GPP, + * shortMessage Don't empty + * @tc.desc Function test + */ + it('Telephony_SmsMms_createMessage_Async_0100', 0, async function (done) { + if (true) { + expect(true).assertTrue(); + done(); + return; + } + sms.createMessage(rawArray, '3gpp', (err, shortMessage) => { + if (err) { + expect().assertFail(); + console.log('Telephony_SmsMms_createMessage_Async_0100 fail'); + done(); + return; + } + expect(shortMessage.visibleMessageBody === MESSAGEBODY).assertTrue(); + expect(shortMessage.visibleRawAddress.length === ADDR_LENGTH).assertTrue(); + expect(shortMessage.messageClass === sms.FORWARD_MESSAGE).assertTrue(); + expect(shortMessage.protocolId === 0).assertTrue(); + expect(shortMessage.scAddress.length === ADDR_LENGTH).assertTrue(); + expect(shortMessage.scTimestamp === SC_TIMESTAMP).assertTrue(); + expect(shortMessage.isReplaceMessage).assertFalse(); + expect(shortMessage.hasReplyPath).assertFalse(); + expect(shortMessage.pdu.length > 0).assertTrue(); + expect(shortMessage.status === 0).assertTrue(); + expect(shortMessage.isSmsStatusReportMessage).assertTrue(); + console.log('Telephony_SmsMms_createMessage_Async_0100 finish'); + done(); + }); + }); + + + + + /* + * @tc.number Telephony_SmsMms_getSmsEncodingScheme_Async_0100 + * @tc.name + * @tc.desc Function test + */ + it('Telephony_SmsMms_getSmsEncodingScheme_Async_0100', 0, async function (done) { + if (true) { + expect(true).assertTrue(); + done(); + return; + } + expect(sms.SMS_ENCODING_UNKNOWN == 0).assertTrue(); + expect(sms.SMS_ENCODING_7BIT == 1).assertTrue(); + expect(sms.SMS_ENCODING_8BIT == 2).assertTrue(); + expect(sms.SMS_ENCODING_16BIT == 3).assertTrue(); + done(); + }); + + /* + * @tc.number Telephony_SmsMms_getSendSmsResult_Async_0100 + * @tc.name + * @tc.desc Function test + */ + it('Telephony_SmsMms_getSendSmsResult_Async_0100', 0, async function (done) { + if (true) { + expect(true).assertTrue(); + done(); + return; + } + expect(sms.SEND_SMS_FAILURE_RADIO_OFF == 0).assertTrue(); + expect(sms.SEND_SMS_FAILURE_SERVICE_UNAVAILABLE == 1).assertTrue(); + expect(sms.SIM_MESSAGE_STATUS_FREE == 0).assertTrue(); + expect(sms.INSTANT_MESSAGE == 1).assertTrue(); + expect(sms.OPTIONAL_MESSAGE == 2).assertTrue(); + done(); + }); + + /* + * @tc.number Telephony_SmsMms_ShortMessageClass_Async_0100 + * @tc.name + * @tc.desc Function test + */ + it('Telephony_SmsMms_ShortMessageClass_Async_0100', 0, async function (done) { + if (true) { + expect(true).assertTrue(); + done(); + return; + } + expect(sms.SIM_MESSAGE_STATUS_FREE == 0).assertTrue(); + expect(sms.INSTANT_MESSAGE == 1).assertTrue(); + expect(sms.OPTIONAL_MESSAGE == 2).assertTrue(); + done(); + }); + /* + * @tc.number Telephony_SmsMms_getMmsCharSets_Async_0100 + * @tc.name + * @tc.desc Function test + */ + it('Telephony_SmsMms_getMmsCharSets_Async_0100', 0, async function (done) { + if (true) { + expect(true).assertTrue(); + done(); + return; + } + expect(sms.BIG5 == 0X07EA).assertTrue(); + expect(sms.ISO_10646_UCS_2 == 0X03E8).assertTrue(); + expect(sms.ISO_8859_1 == 0X04).assertTrue(); + expect(sms.ISO_8859_2 == 0X05).assertTrue(); + expect(sms.ISO_8859_3 == 0X06).assertTrue(); + expect(sms.ISO_8859_4 == 0X07).assertTrue(); + expect(sms.ISO_8859_5 == 0X08).assertTrue(); + expect(sms.ISO_8859_6 == 0X09).assertTrue(); + expect(sms.ISO_8859_7 == 0X10).assertTrue(); + expect(sms.ISO_8859_8 == 0X12).assertTrue(); + expect(sms.ISO_8859_9 == 0X13).assertTrue(); + expect(sms.SHIFT_JIS == 0X11).assertTrue(); + expect(sms.US_ASCII == 0X03).assertTrue(); + expect(sms.UTF_8 == 0X6A).assertTrue(); + done(); + }); + }) +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/StatisticsJsunit.test.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/StatisticsJsunit.test.ets similarity index 97% rename from telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/StatisticsJsunit.test.ets rename to telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/StatisticsJsunit.test.ets index 8535e83e68597b014713c0240a543ac012b707b1..66c5424aba8d035b718b85123bae0fa9f0969ff6 100644 --- a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/StatisticsJsunit.test.ets +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/StatisticsJsunit.test.ets @@ -689,45 +689,7 @@ export default function statisticsUiJsunit() { }); }); - /** - * @tc.number Telephony_statistics_statistics_on_0100 - * @tc.name Test on() to check the callback result - * @tc.desc Function test - */ - it('Telephony_statistics_statistics_on_0100', 0, async function (done) { - if (utils.notCheck) { - expect(true).assertTrue(); - done(); - return; - } - let caseName = 'Telephony_statistics_statistics_on_0100'; - statistics.on('netStatsChange', (data) => { - console.log(`${caseName} on data: ${JSON.stringify(data)}`); - expect(data).assertUndefined(); - done(); - }); - done(); - }); - - /** - * @tc.number Telephony_statistics_statistics_off_0100 - * @tc.name Test off() to check the callback result - * @tc.desc Function test - */ - it('Telephony_statistics_statistics_off_0100', 0, async function (done) { - if (utils.notCheck) { - expect(true).assertTrue(); - done(); - return; - } - let caseName = 'Telephony_statistics_statistics_off_0100'; - statistics.off('netStatsChange', (data) => { - console.log(`${caseName} off data: ${JSON.stringify(data)}`); - expect(data).assertUndefined(); - done(); - }); - done(); - }); + /** * @tc.number Telephony_statistics_getIfaceStatsDetail_Async_0100 * @tc.name Test getIfaceStatsDetail() to check the callback result when iface is test diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/Utils.ets b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/Utils.ets new file mode 100644 index 0000000000000000000000000000000000000000..65f70088ddb62bcf80f4e0ec07dc841a8ab033f0 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/Utils.ets @@ -0,0 +1,119 @@ +// @ts-nocheck +/** + * 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. + */ + +export default class Utils { + static rect_left; + static rect_top; + static rect_right; + static rect_bottom; + static rect_value; + static notCheck = true; + + static sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + static getComponentRect(key) { + let strJson = getInspectorByKey(key); + let obj = JSON.parse(strJson); + console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); + let rectInfo = JSON.parse('[' + obj.$rect + ']') + console.info("[getInspectorByKey] rectInfo is: " + rectInfo); + this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0] + this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1] + this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0] + this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1] + return this.rect_value = { + "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom + } + } + + static async swipe(downX, downY, upX, upY, steps) { + console.info('start to swipe') + this.drags(downX, downY, upX, upY, steps, false) + } + + static async drag(downX, downY, upX, upY, steps) { + console.info('start to drag') + this.drags(downX, downY, upX, upY, steps, true) + } + + static async drags(downX, downY, upX, upY, steps, drag) { + var xStep; + var yStep; + var swipeSteps; + var ret; + xStep = 0; + yStep = 0; + ret = false; + swipeSteps = steps; + if (swipeSteps == 0) { + swipeSteps = 1; + } + xStep = (upX - downX) / swipeSteps; + yStep = (upY - downY) / swipeSteps; + console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) + var downPonit: TouchObject = { + id: 1, + x: downX, + y: downY, + type: TouchType.Down, + } + console.info('down touch started: ' + JSON.stringify(downPonit)) + sendTouchEvent(downPonit); + console.info('start to move') + if (drag) { + await this.sleep(500) + } + for (var i = 1;i <= swipeSteps; i++) { + var movePoint: TouchObject = { + id: 1, + x: downX + (xStep * i), + y: downY + (yStep * i), + type: TouchType.Move + } + console.info('move touch started: ' + JSON.stringify(movePoint)) + ret = sendTouchEvent(movePoint) + if (ret == false) { + break; + } + await this.sleep(5) + } + console.info('start to up') + if (drag) { + await this.sleep(100) + } + var upPoint: TouchObject = { + id: 1, + x: upX, + y: upY, + type: TouchType.Up, + } + console.info('up touch started: ' + JSON.stringify(upPoint)) + sendTouchEvent(upPoint) + await this.sleep(500) + } +} + + + + diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/lib/Const.js b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/lib/Const.js new file mode 100644 index 0000000000000000000000000000000000000000..f9263cd46dee1a0ffdfaa1e5ef5c29755c7e13f7 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/lib/Const.js @@ -0,0 +1,36 @@ +/** + * 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. + */ + +// sim slot id +export const DEFAULT_SLOTID = 0; +export const SLOTID3 = 3; +export const SLOTID2 = 2; +export const SLOTID_MINUS1 = -1; + +// sim correct password +export const CORRECT_PIN = '1234'; +export const CORRECT_PIN2 = '18099014'; + +// sim incorrect password +export const INCORRECT_PIN = '134679'; +export const INCORRECT_PIN_LEN3 = '123'; +export const INCORRECT_PUK = '134679'; +export const INCORRECT_PIN2 = '134679'; +export const INCORRECT_PIN2_LEN3 = '123'; +export const INCORRECT_PIN2_LEN9 = '123456789'; +export const INCORRECT_PUK2 = '134679'; + +// lock status response +export const LOCK_RESULT = { SUCCESS: 0, FAILURE: -1, EXCEPTION: -2 }; \ No newline at end of file diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..03b8532c53ca563f8ed6b1e21d20ad3f67a68906 --- /dev/null +++ b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/base/media/icon.png differ diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/hand.png b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/hand.png new file mode 100644 index 0000000000000000000000000000000000000000..9f1fa16ee073093b40920e273502513fa66fa980 Binary files /dev/null and b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/hand.png differ diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/icon.png b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/icon.png differ diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/images.jpg b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/images.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c75ddfc5ead15e8d49ca7cae9f97c03585565be1 Binary files /dev/null and b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/images.jpg differ diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/person.png b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/person.png new file mode 100644 index 0000000000000000000000000000000000000000..f0f540d078e6c0441a763ca2cc375a551d6cf736 Binary files /dev/null and b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/person.png differ diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/star-1-1.png b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/star-1-1.png new file mode 100644 index 0000000000000000000000000000000000000000..990c5e5ad20698c7701faf641bc80eb004a127b7 Binary files /dev/null and b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/star-1-1.png differ diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/star-1-2.png b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/star-1-2.png new file mode 100644 index 0000000000000000000000000000000000000000..450c3dd3ca68bf601bd08e5f41797d376e20d00d Binary files /dev/null and b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/star-1-2.png differ diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/star-1-3.png b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/star-1-3.png new file mode 100644 index 0000000000000000000000000000000000000000..1044869832b423a5dfc2559a395529377bd34f0c Binary files /dev/null and b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/star-1-3.png differ diff --git a/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/video/show.mp4 b/telephony/telephonyjstest/radiostatistic/entry/src/main/resources/rawfile/video/show.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/telephony/telephonyjstest/radiostatistic/signature/openharmony_sx.p7b b/telephony/telephonyjstest/radiostatistic/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858 Binary files /dev/null and b/telephony/telephonyjstest/radiostatistic/signature/openharmony_sx.p7b differ diff --git a/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/test/SimManager.test.js b/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/test/SimManager.test.js index 573151c81832b6dd1b6f05bff5127df94551a753..6b8d6a20256d10f01a9d2f1c7f3b3c0afa9dd3eb 100644 --- a/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/test/SimManager.test.js +++ b/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/test/SimManager.test.js @@ -258,1251 +258,161 @@ describe('SimManagerTest', function () { done(); }); - /** - * @tc.number Telephony_Sim_getSimGid1_Async_0200 - * @tc.name Enter exception parameters to test whether the getSimGid1 interface function can execute normally. - * @tc.desc Function test - */ - it('Telephony_Sim_getSimGid1_Async_0200', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getSimGid1_Async_0200'; - sim.getSimGid1(env.SLOTID2, (err, data) => { - if (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - expect().assertFail(); - console.log(`${CASE_NAME} fail, data = ${data}`); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_getSimGid1_Promise_0200 - * @tc.name Enter exception parameters to test whether the getSimGid1 interface function can execute normally. - * @tc.desc Function test - */ - it('Telephony_Sim_getSimGid1_Promise_0200', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getSimGid1_Promise_0200'; - try { - var data = await sim.getSimGid1(env.SLOTID2); - } catch (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - expect().assertFail(); - console.log(`${CASE_NAME} fail, data = ${data}`); - done(); - }); - - /** - * @tc.number Telephony_Sim_getSimAccountInfo_Async_0200 - * @tc.name Test getSimAccountInfo async callback interface slotid exception, - * enter parameter 2, and check the callback value - * @tc.desc Function test - */ - it('Telephony_Sim_getSimAccountInfo_Async_0200', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getSimAccountInfo_Async_0200'; - sim.getSimAccountInfo(env.SLOTID2, (err) => { - if (err) { - console.log(`${CASE_NAME} expect error: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - expect().assertFail(); - console.log(`${CASE_NAME} test fail.`); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_getSimAccountInfo_Promise_0200 - * @tc.name Test getSimAccountInfo promise interface slotid exception, - * enter parameter 2, and check the callback value - * @tc.desc Function test - */ - it('Telephony_Sim_getSimAccountInfo_Promise_0200', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getSimAccountInfo_Promise_0200'; - try { - await sim.getSimAccountInfo(env.SLOTID2); - expect().assertFail(); - console.log(`${CASE_NAME} fail`); - } catch (err) { - console.log(`${CASE_NAME} expect error: ${err.message}`); - console.log(`${CASE_NAME} finish`); - } - done(); - }); - - /** - * @tc.number Telephony_Sim_setDefaultVoiceSlotId_Async_0100 - * @tc.name Test the setDefaultVoiceLotid interface when the input SIM ID parameter is 2. - * @tc.desc Function test - */ - it('Telephony_Sim_setDefaultVoiceSlotId_Async_0100', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_setDefaultVoiceSlotId_Async_0100'; - sim.setDefaultVoiceSlotId(env.SLOTID2, (err) => { - if (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - expect().assertFail(); - console.log(`${CASE_NAME} fail`); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_setDefaultVoiceSlotId_Promise_0100 - * @tc.name Test the setDefaultVoiceLotid interface when the input SIM ID parameter is 2. - * @tc.desc Function test - */ - it('Telephony_Sim_setDefaultVoiceSlotId_Promise_0100', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_setDefaultVoiceSlotId_Promise_0100'; - try { - await sim.setDefaultVoiceSlotId(env.SLOTID2); - } catch (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - expect().assertFail(); - console.log(`${CASE_NAME} fail`); - done(); - }); - - /** - * @tc.number Telephony_Sim_getDefaultVoiceSlotId_Async_0200 - * @tc.name The test first sets the default card number and then calls - * the getDefaultVoiceLotid interface to get the SIM ID. - * @tc.desc Function test - */ - it('Telephony_Sim_getDefaultVoiceSlotId_Async_0200', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getDefaultVoiceSlotId_Async_0200'; - sim.getDefaultVoiceSlotId((err, data) => { - if (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_getDefaultVoiceSlotId_Promise_0200 - * @tc.name The test first sets the default card number and then calls - * the getDefaultVoiceLotid interface to get the default SIM ID. - * @tc.desc Function test - */ - it('Telephony_Sim_getDefaultVoiceSlotId_Promise_0200', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getDefaultVoiceSlotId_Promise_0200'; - try { - let data = await sim.getDefaultVoiceSlotId(); - console.log(`${CASE_NAME}, data = ${data}`); - expect().assertFail(); - } catch (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - } - done(); - }); - - /** - * @tc.number Telephony_Sim_unlockPin_Async_0400 - * @tc.name The status of the card is ready state, the unlockPin interface is tested, and slotId is abnormal. - * @tc.desc Function test - */ - it('Telephony_Sim_unlockPin_Async_0400', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_unlockPin_Async_0400'; - sim.unlockPin(env.SLOTID2, env.CORRECT_PIN, err => { - if (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - expect().assertFail(); - console.log(`${CASE_NAME} fail`); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_unlockPin_Promise_0400 - * @tc.name The status of the card is ready state, the unlockPin interface is tested, and slotId is abnormal. - * @tc.desc Function test - */ - it('Telephony_Sim_unlockPin_Promise_0400', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_unlockPin_Promise_0400'; - try { - await sim.unlockPin(env.SLOTID2, env.CORRECT_PIN); - } catch (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - expect().assertFail(); - console.log(`${CASE_NAME} fail`); - done(); - }); - - /** - * @tc.number Telephony_Sim_unlockPuk_Async_0400 - * @tc.name The card status is ready state, and the unlockPuk interface is tested. - * The slotId parameter is abnormal. - * @tc.desc Function test - */ - it('Telephony_Sim_unlockPuk_Async_0400', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_unlockPuk_Async_0400'; - sim.unlockPuk(env.SLOTID2, env.CORRECT_PIN, env.CORRECT_PUK, err => { - if (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - expect().assertFail(); - console.log(`${CASE_NAME} fail`); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_unlockPuk_Promise_0400 - * @tc.name The card status is ready state, and the unlockPuk interface is tested. - * The slotId parameter is abnormal. - * @tc.desc Function test - */ - it('Telephony_Sim_unlockPuk_Promise_0400', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_unlockPuk_Promise_0400'; - try { - await sim.unlockPuk(env.SLOTID2, env.CORRECT_PIN, env.CORRECT_PUK); - } catch (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - console.log(`${CASE_NAME} fail`); - done(); - }); - - /** - * @tc.number Telephony_Sim_alterPin_Async_0400 - * @tc.name The status of the card is ready state, and the alterPin interface. SlotId is abnormal. - * @tc.desc Function test - */ - it('Telephony_Sim_alterPin_Async_0400', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_alterPin_Async_0400'; - sim.alterPin(env.SLOTID2, env.CORRECT_PIN, env.ALTER_PIN, err => { - if (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - expect().assertFail(); - console.log(`${CASE_NAME} fail`); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_alterPin_Promise_0400 - * @tc.name The status of the card is ready state, and the alterPin interface is tested. SlotId is abnormal. - * @tc.desc Function test - */ - it('Telephony_Sim_alterPin_Promise_0400', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_alterPin_Promise_0400'; - try { - await sim.alterPin(env.SLOTID2, env.CORRECT_PIN, env.ALTER_PIN); - } catch (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - expect().assertFail(); - console.log(`${CASE_NAME} fail`); - done(); - }); - - /** - * @tc.number Telephony_Sim_SetLockState_Async_1000 - * @tc.name The card is in the ready state, test the SetLockState async callback interface - * slotId exception into the parameter 2, check the callback value - * @tc.desc Function test - */ - it('Telephony_Sim_SetLockState_Async_1000', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_SetLockState_Async_1000'; - const lockInfo = { lockType: sim.PIN_LOCK, state: sim.LOCK_OFF, password: env.CORRECT_PIN }; - sim.setLockState(env.SLOTID2, lockInfo, (error) => { - if (error) { - console.log(`${CASE_NAME} setLockState expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish`); - done(); - return; - } - console.log(`${CASE_NAME} test fail`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_SetLockState_Promise_1000 - * @tc.name The card is in the ready state, test the SetLockState promise interface - * slotId exception into the parameter 2, check the callback value - * @tc.desc Function test - */ - it('Telephony_Sim_SetLockState_Promise_1000', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_SetLockState_Promise_1000'; - const lockInfo = { lockType: sim.PIN_LOCK, state: sim.LOCK_OFF, password: env.CORRECT_PIN }; - try { - await sim.setLockState(env.SLOTID2, lockInfo); - console.log(`${CASE_NAME} test fail`); - expect().assertFail(); - } catch (error) { - console.log(`${CASE_NAME} setLockState expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish`); - } - done(); - }); - - /** - * @tc.number Telephony_Sim_GetSimIccId_Async_0600 - * @tc.name CDMA file, getSimIccId async callback interface slotId - * exception enters parameter -1 test - * @tc.desc Function test - */ - it('Telephony_Sim_GetSimIccId_Async_0600', 0, function (done) { - const CASE_NAME = 'Telephony_Sim_GetSimIccId_Async_0600'; - sim.getSimIccId(env.SLOTID2, error => { - if (error) { - console.log(`${CASE_NAME} getSimIccId expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish.`); - done(); - return; - } - expect().assertFail(); - console.log(`${CASE_NAME} test fail.`); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_GetSimIccId_Promise_0600 - * @tc.name CDMA file, getSimIccId promise interface slotId - * exception enters parameter -1 test - * @tc.desc Function test - */ - it('Telephony_Sim_GetSimIccId_Promise_0600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_GetSimIccId_Promise_0600'; - try { - await sim.getSimIccId(env.SLOTID2); - expect().assertFail(); - console.log(`${CASE_NAME} test fail.`); - } catch (error) { - console.log(`${CASE_NAME} getSimIccId expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish.`); - } - done(); - }); - - /** - * @tc.number Telephony_Sim_getIMSI_Async_0200 - * @tc.name To test the getIMSI interface, enter slotid as 4 and expect the result to enter err. - * @tc.desc Function test - */ - it('Telephony_Sim_getIMSI_Async_0200', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getIMSI_Async_0200'; - sim.getIMSI(env.SLOTID2, err => { - if (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - expect().assertFail(); - console.log(`${CASE_NAME} fail`); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_getIMSI_Promise_0200 - * @tc.name To test the getIMSI interface, enter slotid as 4 and expect the result to enter err. - * @tc.desc Function test - */ - it('Telephony_Sim_getIMSI_Promise_0200', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getIMSI_Async_0200'; - try { - await sim.getIMSI(env.SLOTID2); - } catch (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - expect().assertFail(); - console.log(`${CASE_NAME} fail`); - done(); - }); - - /** - * @tc.number Telephony_Sim_isSimActive_Async_0700 - * @tc.name Test the slotId exception input parameter 2 during isSimActive interface card activation, - * check the callback value, and expect the callback result flase - * @tc.desc Function test - */ - it('Telephony_Sim_isSimActive_Async_0700', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_isSimActive_Async_0700'; - sim.isSimActive(env.SLOTID2, (err, data) => { - if (err) { - console.log(`${CASE_NAME} fail, err: ${err.message}`); - expect().assertFail(); - done(); - return; - } - expect(data).assertFalse(); - console.log(`${CASE_NAME} finish`); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_isSimActive_Promise_0700 - * @tc.name Test the slotId exception input parameter 2 during isSimActive interface card activation, - * check the callback value, and expect the callback result flase - * @tc.desc Function test - */ - it('Telephony_Sim_isSimActive_Promise_0700', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_isSimActive_Promise_0700'; - try { - let data = await sim.isSimActive(env.SLOTID2); - expect(data).assertFalse(); - } catch (err) { - console.log(`${CASE_NAME} isSimActive fail, err: ${err.message}`); - expect().assertFail(); - done(); - return; - } - console.log(`${CASE_NAME} finish`); - done(); - }); - - /** - * @tc.number Telephony_Sim_activateSim_Async_0600 - * @tc.name Test the slotId exception input parameter 2 of activateSim interface, - * check the callback value, and expect to enter ERR - * @tc.desc Function test - */ - it('Telephony_Sim_activateSim_Async_0600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_activateSim_Async_0600'; - sim.activateSim(env.SLOTID2, (err) => { - if (err) { - console.log(`${CASE_NAME} finish, err: ${err.message}`); - done(); - return; - } - console.log(`${CASE_NAME} fail`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_activateSim_Promise_0600 - * @tc.name Test the slotId exception input parameter 2 of activateSim interface, - * check the callback value, and expect to enter ERR - * @tc.desc Function test - */ - it('Telephony_Sim_activateSim_Promise_0600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_activateSim_Promise_0600'; - try { - await sim.activateSim(env.SLOTID2); - } catch (err) { - console.log(`${CASE_NAME} finish, err: ${err.message}`); - done(); - return; - } - console.log(`${CASE_NAME} fail`); - expect().assertFail(); - done(); - }); - - /** - * @tc.number Telephony_Sim_deactivateSim_Async_0600 - * @tc.name Test the deactivateSim interface slotId exception input parameter 2 - * and check the callback value, expecting to enter ERR - * @tc.desc Function test - */ - it('Telephony_Sim_deactivateSim_Async_0600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_deactivateSim_Async_0600'; - sim.deactivateSim(env.SLOTID2, (err) => { - if (err) { - console.log(`${CASE_NAME} finish, err: ${err.message}`); - done(); - return; - } - console.log(`${CASE_NAME} fail`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_deactivateSim_Promise_0600 - * @tc.name Test the deactivateSim interface slotId exception input parameter - * 2 and check the callback value, expecting to enter ERR - * @tc.desc Function test - */ - it('Telephony_Sim_deactivateSim_Promise_0600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_deactivateSim_Promise_0600'; - try { - await sim.deactivateSim(env.SLOTID2); - } catch (err) { - console.log(`${CASE_NAME} finish, err: ${err.message}`); - done(); - return; - } - console.log(`${CASE_NAME} fail`); - expect().assertFail(); - done(); - }); - - /** - * @tc.number Telephony_Sim_hasSimCard_Async_0600 - * @tc.name Test the slotId exception input parameter 2 of the hasSimCard interface, - * check the callback value, and expect the callback result flase - * @tc.desc Function test - */ - it('Telephony_Sim_hasSimCard_Async_0600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_hasSimCard_Async_0600'; - sim.hasSimCard(env.SLOTID2, (err, data) => { - if (err) { - expect().assertFail(); - console.log(`${CASE_NAME} fail, err: ${err.message}`); - done(); - return; - } - expect(data).assertFalse(); - console.log(`${CASE_NAME} finish`); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_hasSimCard_Promise_0600 - * @tc.name Test the slotId exception input parameter 2 of the hasSimCard interface, - * check the callback value, and expect the callback result flase - * @tc.desc Function test - */ - it('Telephony_Sim_hasSimCard_Promise_0600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_hasSimCard_Promise_0600'; - try { - let data = await sim.hasSimCard(env.SLOTID2); - expect(data).assertFalse(); - } catch (err) { - expect().assertFail(); - console.log(`${CASE_NAME} fail, err: ${err.message}`); - done(); - return; - } - console.log(`${CASE_NAME} finish`); - done(); - }); - - /** - * @tc.number Telephony_Sim_setShowName_Async_0700 - * @tc.name Test setShowName slotId exception input parameter 2 to check the - * callback value, expecting to enter ERR - * @tc.desc Function test - */ - it('Telephony_Sim_setShowName_Async_0700', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_setShowName_Async_0700'; - sim.setShowName(env.SLOTID2, env.CARD_NAME, (err) => { - if (err) { - console.log(`${CASE_NAME} finish, err: ${err.message}`); - done(); - return; - } - console.log(`${CASE_NAME} fail`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_setShowName_Promise_0700 - * @tc.name Test setShowName promise interface slotId exception into parameter 2, check the return value - * @tc.desc Function test - */ - it('Telephony_Sim_setShowName_Promise_0700', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_setShowName_Promise_0700'; - try { - await sim.setShowName(env.SLOTID2, env.CARD_NAME); - } catch (err) { - console.log(`${CASE_NAME} finish, error : ${err.message}`); - done(); - return; - } - console.log(`${CASE_NAME} fail`); - expect().assertFail(); - done(); - }); - - /** - * @tc.number Telephony_Sim_getShowName_Async_0700 - * @tc.name Test the slotId exception input parameter 2 of getShowName and - * check the return value, expecting to enter ERR - * @tc.desc Function test - */ - it('Telephony_Sim_getShowName_Async_0700', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getShowName_Async_0700'; - sim.getShowName(env.SLOTID2, (err, data) => { - if (err) { - console.log(`${CASE_NAME} finish, err: ${err.message}`); - done(); - return; - } - console.log(`${CASE_NAME} , data : ${data}`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_getShowName_Promise_0700 - * @tc.name Test the slotId exception input parameter 2 of getShowName and check the - * return value, expecting to enter ERR - * @tc.desc Function test - */ - - it('Telephony_Sim_getShowName_Promise_0700', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getShowName_Promise_0700'; - try { - let data = await sim.getShowName(env.SLOTID2); - console.log(`${CASE_NAME} fail, data : ${data}`); - expect().assertFail(); - done(); - } catch (err) { - console.log(`${CASE_NAME} finish, err: ${err.message}`); - done(); - } - }); - - /** - * @tc.number Telephony_Sim_setShowNumber_Async_0700 - * @tc.name Test setShowNumber slotId exception input parameter 2, check the callback value, - * and expect to enter err - * @tc.desc Function test - */ - it('Telephony_Sim_setShowNumber_Async_0700', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_setShowNumber_Async_0700'; - sim.setShowNumber(env.SLOTID2, env.CARD_NUMBER, (err) => { - if (err) { - console.log(`${CASE_NAME} finish, err: ${err.message}`); - done(); - return; - } - console.log(`${CASE_NAME} fail`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_setShowNumber_Promise_0700 - * @tc.name Test setShowNumber slotId exception input parameter 2 and check - * the return value, expecting to enter ERR - * @tc.desc Function test - */ - it('Telephony_Sim_setShowNumber_Promise_0700', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_setShowNumber_Promise_0700'; - try { - await sim.setShowNumber(env.SLOTID2, env.CARD_NUMBER); - console.log(`${CASE_NAME} fail`); - expect().assertFail(); - done(); - } catch (err) { - console.log(`${CASE_NAME} finish, err: ${err.message}`); - done(); - } - }); - - /** - * @tc.number Telephony_Sim_getShowNumber_Async_0600 - * @tc.name Test the slotId exception of the getShowNumber async callback interface into parameter 2, - * check the callback value - * @tc.desc Function test - */ - it('Telephony_Sim_getShowNumber_Async_0600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getShowNumber_Async_0600'; - sim.getShowNumber(env.SLOTID2, (err, data) => { - if (err) { - console.log(`${CASE_NAME} finish, err: ${err.message}`); - done(); - return; - } - console.log(`${CASE_NAME} fail, data : ${data}`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_getShowNumber_Promise_0600 - * @tc.name Test the slotId exception of the getShowNumber interface into parameter 2, check the callback value - * @tc.desc Function test - */ - it('Telephony_Sim_getShowNumber_Promise_0600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getShowNumber_Promise_0600'; - try { - let data = await sim.getShowNumber(env.SLOTID2); - console.log(`${CASE_NAME} fail, data : ${data}`); - expect().assertFail(); - done(); - } catch (err) { - console.log(`${CASE_NAME} finish, err: ${err.message}`); - done(); - } - }); - - /** - * @tc.number Telephony_Sim_getOperatorConfigs_Async_0700 - * @tc.name Test the getOperatorConfigs slotId exception input parameter 2 and check the - * callback value, expecting to enter err - * @tc.desc Function test - */ - it('Telephony_Sim_getOperatorConfigs_Async_0700', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getOperatorConfigs_Async_0700'; - sim.getOperatorConfigs(env.SLOTID2, (err, data) => { - if (err) { - console.log(`${CASE_NAME} finish, err: ${err.message}`); - done(); - return; - } - console.log(`${CASE_NAME} , data : ${data}`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_getOperatorConfigs_Promise_0700 - * @tc.name Test the getOperatorConfigs slotId exception input parameter 2 and check - * the callback value, expecting to enter err - * @tc.desc Function test - */ - it('Telephony_Sim_getOperatorConfigs_Promise_0700', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getOperatorConfigs_Promise_0700'; - try { - let data = await sim.getOperatorConfigs(env.SLOTID2); - console.log(`${CASE_NAME} fail, data : ${data}`); - expect().assertFail(); - done(); - } catch (err) { - console.log(`${CASE_NAME} finish, err: ${err.message}`); - done(); - } - }); - - /** - * @tc.number Telephony_Sim_getActiveSimAccountInfoList_Async_0500 - * @tc.name When there is no card, test the getActiveSimAccountInfoList interface and check the return value - * @tc.desc Function test - */ - it('Telephony_Sim_getActiveSimAccountInfoList_Async_0500', 0, function (done) { - const CASE_NAME = 'Telephony_Sim_getActiveSimAccountInfoList_Async_0500'; - sim.getActiveSimAccountInfoList(error => { - if (error) { - console.log(`${CASE_NAME} expect error: ${error.message}`); - } else { - console.log(`${CASE_NAME} test fail.`); - expect().assertFail(); - } - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_getActiveSimAccountInfoList_Promise_0500 - * @tc.name When there is no card, test the getActiveSimAccountInfoList interface and check the return value - * @tc.desc Function test - */ - it('Telephony_Sim_getActiveSimAccountInfoList_Promise_0500', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getActiveSimAccountInfoList_Async_0500'; - try { - await sim.getActiveSimAccountInfoList(); - expect().assertFail(); - console.log(`${CASE_NAME} test fail.`); - } catch (error) { - console.log(`${CASE_NAME} expect error: ${error.message}`); - } - done(); - }); - - /** - * @tc.number Telephony_Sim_unlockPin2_Async_1000 - * @tc.name Test slotid exception input parameter 2 of unlockPin2 and check the callback - * value, expecting to enter ERR - * @tc.desc Function test - */ - it('Telephony_Sim_unlockPin2_Async_1000', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_unlockPin2_Async_1000'; - sim.unlockPin2(env.SLOTID2, env.INCORRECT_PIN2, (err, data) => { - if (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - console.log(`${CASE_NAME} , data: ${JSON.stringify(data)}`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_unlockPin2_Promise_1000 - * @tc.name Test slotid exception input parameter 2 of unlockPin2 and check the callback - * value, expecting to enter ERR - * @tc.desc Function test - */ - it('Telephony_Sim_unlockPin2_Promise_1000', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_unlockPin2_Promise_1000'; - try { - await sim.unlockPin2(env.SLOTID2, env.INCORRECT_PIN2); - expect().assertFail(); - } catch (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - } - done(); - }); - - /** - * @tc.number Telephony_Sim_unlockPuk2_Async_1100 - * @tc.name Test the slotId exception input parameter 2 of the unlockPuk2 - * interface and check the callback value, expecting to enter ERR - * @tc.desc Function test - */ - it('Telephony_Sim_unlockPuk2_Async_1100', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_unlockPuk2_Async_1100'; - sim.unlockPuk2(env.SLOTID2, env.INCORRECT_PIN2, env.INCORRECT_PUK2_LEN8, (err, data) => { - if (err) { - console.log(`${CASE_NAME} expect err: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - console.log(`${CASE_NAME}, data: ${JSON.stringify(data)}`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_unlockPuk2_Promise_1100 - * @tc.name Test the slotId exception input parameter 2 of the unlockPuk2 interface - * and check the callback value, expecting to enter ERR - * @tc.desc Function test - */ - it('Telephony_Sim_unlockPuk2_Promise_1100', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_unlockPuk2_Async_1100'; - try { - const data = await sim.unlockPuk2(env.SLOTID2, env.INCORRECT_PIN2, env.INCORRECT_PUK2_LEN8); - console.log(`${CASE_NAME}, data: ${JSON.stringify(data)}`); - expect().assertFail(); - } catch (error) { - console.log(`${CASE_NAME} expect err: ${error.message}`); - console.log(`${CASE_NAME} finish`); - } - done(); - }); - - /** - * @tc.number Telephony_Sim_alterPin2_Async_1100 - * @tc.name Test alterPin2 interface exception slotId input parameter 2, check the callback - * value, expecting to enter err - * @tc.desc Function test - */ - it('Telephony_Sim_alterPin2_Async_1100', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_alterPin2_Async_1100'; - sim.alterPin2(env.SLOTID2, env.INCORRECT_PIN2, env.INCORRECT_PIN2, (err, data) => { - if (err) { - console.log(`${CASE_NAME} expect error: ${err.message}`); - console.log(`${CASE_NAME} finish`); - done(); - return; - } - console.log(`${CASE_NAME} data: ${JSON.stringify(data)}`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_alterPin2_Promise_1100 - * @tc.name Test alterPin2 interface exception slotId input parameter 2, check the callback - * value, expecting to enter err - * @tc.desc Function test - */ - it('Telephony_Sim_alterPin2_Promise_1100', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_alterPin2_Promise_1100'; - try { - const data = await sim.alterPin2(env.SLOTID2, env.INCORRECT_PIN2, env.INCORRECT_PIN2); - console.log(`${CASE_NAME} data: ${JSON.stringify(data)}`); - expect().assertFail(); - } catch (error) { - console.log(`${CASE_NAME} expect error: ${error.message}`); - console.log(`${CASE_NAME} finish`); - } - done(); - }); - - /** - * @tc.number Telephony_Sim_queryIccDiallingNumbers_Async_0800 - * @tc.name Test sim.queryIccDiallingNumbers(soltId: 2, type: 1, callback: - * AsyncCallback>), expect return an empty array. - * @tc.desc Function test - */ - it('Telephony_Sim_queryIccDiallingNumbers_Async_0800', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_queryIccDiallingNumbers_Async_0800'; - sim.queryIccDiallingNumbers(env.SLOTID2, sim.GENERAL_CONTACT, (error, data) => { - if (error) { - console.log(`${CASE_NAME} query error: ${error.message}`); - expect().assertFail(); - done(); - return; - } - expect(data.length === 0).assertTrue(); - console.log(`${CASE_NAME} finish`); - done(); - }); - }); - - /** - * @tc.number elephony_Sim_queryIccDiallingNumbers_Promise_0800 - * @tc.name Test sim.queryIccDiallingNumbers(soltId: 2, type: 1):Promise> - * promise interface, expect result is an empty array. - * @tc.desc Function test - */ - it('telephony_Sim_queryIccDiallingNumbers_Promise_0800', 0, async function (done) { - const CASE_NAME = 'telephony_Sim_queryIccDiallingNumbers_Promise_0800'; - try { - const contacts = await sim.queryIccDiallingNumbers(env.SLOTID2, sim.GENERAL_CONTACT); - expect(contacts.length === 0).assertTrue(); - console.log(`${CASE_NAME} test finish.`); - } catch (error) { - console.log(`${CASE_NAME} query error:${error.message}`); - expect().assertFail(); - } - done(); - }); - - /** - * @tc.number Telephony_Sim_addIccDiallingNumbers_Async_0900 - * @tc.name Test sim.addIccDiallingNumbers(soltId: 2, type: 1, diallingNumbers: - * {recordNumber: 1, alphaTag: 'test', number: '12345678', pin2: '123@#ABCD'}, - * callback: AsyncCallback) async callback interface, expect enter error. - * @tc.desc Function test - */ - it('Telephony_Sim_addIccDiallingNumbers_Async_0900', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_addIccDiallingNumbers_Async_0900'; - const CONTACT_INFO = { 'recordNumber': 1, 'alphaTag': 'test', 'number': '12345678' }; - const GENERAL_CONTACT_INFO = Object.assign({}, { 'pin2': env.INCORRECT_PIN2 }, CONTACT_INFO); - sim.addIccDiallingNumbers(env.SLOTID2, sim.GENERAL_CONTACT, GENERAL_CONTACT_INFO, error => { - if (error) { - console.log(`${CASE_NAME} expect error: ${error.message}`); - console.log(`${CASE_NAME} finish.`); - } else { - console.log(`${CASE_NAME} test fail.`); - expect().assertFail(); - } - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_addIccDiallingNumbers_Promise_0900 - * @tc.name Test sim.addIccDiallingNumbers(soltId: 2, type: 1, diallingNumbers: - * {recordNumber: 1, alphaTag: 'test', number: '12345678', pin2: '123@#ABCD'}): Promise - * promise interface, expect enter error. - * @tc.desc Function test - */ - it('Telephony_Sim_addIccDiallingNumbers_Promise_0900', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_addIccDiallingNumbers_Promise_0900'; - const CONTACT_INFO = { 'recordNumber': 1, 'alphaTag': 'test', 'number': '12345678' }; - const GENERAL_CONTACT_INFO = Object.assign({}, { 'pin2': env.INCORRECT_PIN2 }, CONTACT_INFO); - try { - await sim.addIccDiallingNumbers(env.SLOTID2, sim.GENERAL_CONTACT, GENERAL_CONTACT_INFO); - console.log(`${CASE_NAME} test fail.`); - expect().assertFail(); - } catch (error) { - console.log(`${CASE_NAME} expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish.`); - } - done(); - }); - - /** - * @tc.number Telephony_Sim_delIccDiallingNumbers_Async_0900 - * @tc.name Test sim.delIccDiallingNumbers(soltId: 2, type: 1, diallingNumbers: DiallingNumbersInfo, - * callback: AsyncCallback) async callback interface, expect enter error. - * @tc.desc Function test - */ - it('Telephony_Sim_delIccDiallingNumbers_Async_0900', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_delIccDiallingNumbers_Async_0900'; - const CONTACT_INFO = { 'recordNumber': 1, 'alphaTag': 'test', 'number': '12345678' }; - sim.delIccDiallingNumbers(env.SLOTID2, sim.GENERAL_CONTACT, CONTACT_INFO, error => { - if (error) { - console.log(`${CASE_NAME} expect error: ${error.message}`); - console.log(`${CASE_NAME} finish.`); - } else { - console.log(`${CASE_NAME} test fail.`); - expect().assertFail(); - } - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_delIccDiallingNumbers_Promise_0900 - * @tc.name Test sim.delIccDiallingNumbers(soltId: 2, type: 1, diallingNumbers: DiallingNumbersInfo): - * Promise promise interface to delete record, expect enter error. - * @tc.desc Function test - */ - it('Telephony_Sim_delIccDiallingNumbers_Promise_0900', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_delIccDiallingNumbers_Promise_0900'; - const CONTACT_INFO = { 'recordNumber': 1, 'alphaTag': 'test', 'number': '12345678' }; - try { - await sim.delIccDiallingNumbers(env.SLOTID2, sim.GENERAL_CONTACT, CONTACT_INFO); - console.log(`${CASE_NAME} test fail.`); - expect().assertFail(); - } catch (error) { - console.log(`${CASE_NAME} expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish`); - } - done(); - }); - - /** - * @tc.number Telephony_Sim_updateIccDiallingNumbers_Async_1200 - * @tc.name Test sim.updateIccDiallingNumbers(soltId: 2, type: 1, diallingNumbers: - * {recordNumber: 1, alphaTag: 'test_Update', number: '87654321', pin2:'123@#ABCD'}, callback: - * AsyncCallback) async callback interface, expect enter error. - * @tc.desc Function test - */ - it('Telephony_Sim_updateIccDiallingNumbers_Async_1200', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_updateIccDiallingNumbers_Async_1200'; - let updateInfo = { recordNumber: 1, alphaTag: 'test_Update', number: '87654321', pin2: '123@#ABCD' }; - sim.updateIccDiallingNumbers(env.SLOTID2, sim.GENERAL_CONTACT, updateInfo, error => { - if (error) { - console.log(`${CASE_NAME} expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish.`); - done(); - return; - } - console.log(`${CASE_NAME} test fail.`); - expect().assertFail(); - done(); - }); - }); + + - /** - * @tc.number Telephony_Sim_updateIccDiallingNumbers_Promise_1200 - * @tc.name Test sim.updateIccDiallingNumbers(soltId: 2, type: 1, diallingNumbers: - * {recordNumber: 1, alphaTag: 'test_Update', number: '87654321', pin2:'123@#ABCD'}) - * promise interface, expect enter error. - * @tc.desc Function test - */ - it('Telephony_Sim_updateIccDiallingNumbers_Promise_1200', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_updateIccDiallingNumbers_Promise_1200'; - let updateInfo = { recordNumber: 1, alphaTag: 'test_Update', number: '87654321', pin2: '123@#ABCD' }; - try { - console.log(`${CASE_NAME} update`); - await sim.updateIccDiallingNumbers(env.SLOTID2, sim.GENERAL_CONTACT, updateInfo); - console.log(`${CASE_NAME} test fail.`); - expect().assertFail(); - } catch (error) { - console.log(`${CASE_NAME} expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish.`); - } - done(); - }); + /** - * @tc.number Telephony_Sim_getSimTelephoneNumber_Async_0600 - * @tc.name Test getSimTelephoneNumber slotId exception input parameter 2, - * check the callback value, and expect to enter err - * @tc.desc Function test - */ - it('Telephony_Sim_getSimTelephoneNumber_Async_0600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getSimTelephoneNumber_Async_0600'; - sim.getSimTelephoneNumber(env.SLOTID2, (err, data) => { + * @tc.number Telephony_Sim_getDefaultVoiceSlotId_Async_0200 + * @tc.name The test first sets the default card number and then calls + * the getDefaultVoiceLotid interface to get the SIM ID. + * @tc.desc Function test + */ + it('Telephony_Sim_getDefaultVoiceSlotId_Async_0200', 0, async function (done) { + const CASE_NAME = 'Telephony_Sim_getDefaultVoiceSlotId_Async_0200'; + sim.getDefaultVoiceSlotId((err, data) => { if (err) { + console.log(`${CASE_NAME} expect err: ${err.message}`); console.log(`${CASE_NAME} finish`); done(); return; } - console.log(`${CASE_NAME} , data : ${data}`); expect().assertFail(); done(); }); }); /** - * @tc.number Telephony_Sim_getSimTelephoneNumber_Promise_0600 - * @tc.name Test getSimTelephoneNumber slotId exception input parameter 2, check the callback - * value, and expect to enter err - * @tc.desc Function test - */ - it('Telephony_Sim_getSimTelephoneNumber_Promise_0600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getSimTelephoneNumber_Promise_0600'; - let data; + * @tc.number Telephony_Sim_getDefaultVoiceSlotId_Promise_0200 + * @tc.name The test first sets the default card number and then calls + * the getDefaultVoiceLotid interface to get the default SIM ID. + * @tc.desc Function test + */ + it('Telephony_Sim_getDefaultVoiceSlotId_Promise_0200', 0, async function (done) { + const CASE_NAME = 'Telephony_Sim_getDefaultVoiceSlotId_Promise_0200'; try { - data = await sim.getSimTelephoneNumber(env.SLOTID2); + let data = await sim.getDefaultVoiceSlotId(); + console.log(`${CASE_NAME}, data = ${data}`); + expect().assertFail(); } catch (err) { + console.log(`${CASE_NAME} expect err: ${err.message}`); console.log(`${CASE_NAME} finish`); - done(); - return; } - console.log(`${CASE_NAME}, data : ${data}`); - expect().assertFail(); done(); }); + + + + + + + + + + + /** - * @tc.number Telephony_Sim_getVoiceMailIdentifier_Async_0600 - * @tc.name Test getVoiceMailIdentifier slotId exception input parameter 2, check the - * callback value, and expect to enter err + * @tc.number Telephony_Sim_isSimActive_Async_0700 + * @tc.name Test the slotId exception input parameter 2 during isSimActive interface card activation, + * check the callback value, and expect the callback result flase * @tc.desc Function test */ - it('Telephony_Sim_getVoiceMailIdentifier_Async_0600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getVoiceMailIdentifier_Async_0600'; - sim.getVoiceMailIdentifier(env.SLOTID2, (err, data) => { + it('Telephony_Sim_isSimActive_Async_0700', 0, async function (done) { + const CASE_NAME = 'Telephony_Sim_isSimActive_Async_0700'; + sim.isSimActive(env.SLOTID2, (err, data) => { if (err) { - console.log(`${CASE_NAME} finish`); + console.log(`${CASE_NAME} fail, err: ${err.message}`); + expect().assertFail(); done(); return; } - console.log(`${CASE_NAME} , data : ${data}`); - expect().assertFail(); + expect(data).assertFalse(); + console.log(`${CASE_NAME} finish`); done(); }); }); /** - * @tc.number Telephony_Sim_getVoiceMailIdentifier_Promise_0600 - * @tc.name Test getVoiceMailIdentifier slotId exception input parameter 2, check the callback - * value, and expect to enter err + * @tc.number Telephony_Sim_isSimActive_Promise_0700 + * @tc.name Test the slotId exception input parameter 2 during isSimActive interface card activation, + * check the callback value, and expect the callback result flase * @tc.desc Function test */ - it('Telephony_Sim_getVoiceMailIdentifier_Promise_0600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getVoiceMailIdentifier_Promise_0600'; - let data; + it('Telephony_Sim_isSimActive_Promise_0700', 0, async function (done) { + const CASE_NAME = 'Telephony_Sim_isSimActive_Promise_0700'; try { - data = await sim.getVoiceMailIdentifier(env.SLOTID2); + let data = await sim.isSimActive(env.SLOTID2); + expect(data).assertFalse(); } catch (err) { - console.log(`${CASE_NAME} finish`); + console.log(`${CASE_NAME} isSimActive fail, err: ${err.message}`); + expect().assertFail(); done(); return; } - console.log(`${CASE_NAME}, data : ${data}`); - expect().assertFail(); + console.log(`${CASE_NAME} finish`); done(); }); + + + + /** - * @tc.number Telephony_Sim_getVoiceMailNumber_Async_0600 - * @tc.name Test getVoiceMailNumber slotId exception input parameter 2, check the callback - * value, and expect to enter ERR - * @tc.desc Function test - */ - it('Telephony_Sim_getVoiceMailNumber_Async_0600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getVoiceMailNumber_Async_0600'; - sim.getVoiceMailNumber(env.SLOTID2, (err, data) => { + * @tc.number Telephony_Sim_hasSimCard_Async_0600 + * @tc.name Test the slotId exception input parameter 2 of the hasSimCard interface, + * check the callback value, and expect the callback result flase + * @tc.desc Function test + */ + it('Telephony_Sim_hasSimCard_Async_0600', 0, async function (done) { + const CASE_NAME = 'Telephony_Sim_hasSimCard_Async_0600'; + sim.hasSimCard(env.SLOTID2, (err, data) => { if (err) { - console.log(`${CASE_NAME} finish`); + expect().assertFail(); + console.log(`${CASE_NAME} fail, err: ${err.message}`); done(); return; } - console.log(`${CASE_NAME} , data : ${data}`); - expect().assertFail(); + expect(data).assertFalse(); + console.log(`${CASE_NAME} finish`); done(); }); }); /** - * @tc.number Telephony_Sim_getVoiceMailNumber_Promise_0600 - * @tc.name Test getVoiceMailNumber slotId exception input parameter 2, check the callback - * value, and expect to enter ERR - * @tc.desc Function test - */ - it('Telephony_Sim_getVoiceMailNumber_Promise_0600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_getVoiceMailNumber_Promise_0600'; - let data; + * @tc.number Telephony_Sim_hasSimCard_Promise_0600 + * @tc.name Test the slotId exception input parameter 2 of the hasSimCard interface, + * check the callback value, and expect the callback result flase + * @tc.desc Function test + */ + it('Telephony_Sim_hasSimCard_Promise_0600', 0, async function (done) { + const CASE_NAME = 'Telephony_Sim_hasSimCard_Promise_0600'; try { - data = await sim.getVoiceMailNumber(env.SLOTID2); + let data = await sim.hasSimCard(env.SLOTID2); + expect(data).assertFalse(); } catch (err) { - console.log(`${CASE_NAME} finish`); + expect().assertFail(); + console.log(`${CASE_NAME} fail, err: ${err.message}`); done(); return; } - console.log(`${CASE_NAME}, data : ${data}`); - expect().assertFail(); + console.log(`${CASE_NAME} finish`); done(); }); - /** - * @tc.number Telephony_Sim_setVoiceMailInfo_Async_0400 - * @tc.name Test the setVoiceMailInfo async callback interface, slotId is 2, expect enter error. - * @tc.desc Function test - */ - it('Telephony_Sim_setVoiceMailInfo_Async_0400', 0, function (done) { - const CASE_NAME = 'Telephony_Sim_setVoiceMailInfo_Async_0400'; - sim.setVoiceMailInfo(env.SLOTID2, env.MAIL_NAME_LEN12, env.MAIL_NUMBER_LEN20, error => { - if (error) { - console.log(`${CASE_NAME} setVoiceMailInfo expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish`); - } else { - console.log(`${CASE_NAME} test fail.`); - expect().assertFail(); - } - done(); - }); - }); + + + + + + + + + + + - /** - * @tc.number Telephony_Sim_setVoiceMailInfo_Promise_0400 - * @tc.name Test the setVoiceMailInfo promise interface, slotId is 2, expect enter error. - * @tc.desc Function test - */ - it('Telephony_Sim_setVoiceMailInfo_Promise_0400', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_setVoiceMailInfo_Promise_0400'; - try { - await sim.setVoiceMailInfo(env.SLOTID2, env.MAIL_NAME_LEN12, env.MAIL_NUMBER_LEN20); - console.log(`${CASE_NAME} test fail.`); - expect().assertFail(); - } catch (error) { - console.log(`${CASE_NAME} setVoiceMailInfo expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish`); - } - done(); - }); /** * @tc.number Telephony_Sim_getMaxSimCount_0100 @@ -1517,45 +427,6 @@ describe('SimManagerTest', function () { done(); }); - /** - * @tc.number Telephony_Sim_GetLockState_Async_0300 - * @tc.name Test the GetLockState async callback interface, enter parameter 2 - * for slotId exception, check the callback value - * @tc.desc Function test - */ - it('Telephony_Sim_GetLockState_Async_0300', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_GetLockState_Async_0300'; - sim.getLockState(env.SLOTID2, sim.PIN_LOCK, error => { - if (error) { - console.log(`${CASE_NAME} getLockState expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish`); - done(); - return; - } - console.log(`${CASE_NAME} test fail`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_GetLockState_Promise_0300 - * @tc.name Test the GetLockState promise interface, enter parameter 2 - * for slotId exception, check the callback value - * @tc.desc Function test - */ - it('Telephony_Sim_GetLockState_Promise_0300', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_GetLockState_Promise_0300'; - try { - await sim.getLockState(env.SLOTID2, sim.PIN_LOCK); - console.log(`${CASE_NAME} test fail`); - expect().assertFail(); - } catch (error) { - console.log(`${CASE_NAME} getLockState expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish`); - } - done(); - }); /** * @tc.number Telephony_Sim_GetCardType_Async_0400 @@ -1597,85 +468,9 @@ describe('SimManagerTest', function () { done(); }); - /** - * @tc.number Telephony_Sim_SendEnvelopeCmd_Async_0300 - * @tc.name Test SendEnvelopeCmd async callback interface, enter parameter 2 - * for slotId exception, check the callback value - * @tc.desc Function test - */ - it('Telephony_Sim_SendEnvelopeCmd_Async_0300', 0, function (done) { - const CASE_NAME = 'Telephony_Sim_SendEnvelopeCmd_Async_0300'; - sim.sendEnvelopeCmd(env.SLOTID2, env.STK_CMD, (error) => { - if (error) { - console.log(`${CASE_NAME} SendEnvelopeCmd expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish`); - done(); - return; - } - console.log(`${CASE_NAME} test fail`); - expect().assertFail(); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_SendEnvelopeCmd_Promise_0300 - * @tc.name Test SendEnvelopeCmd promise interface, enter parameter 2 - * for slotId exception, check the callback value - * @tc.desc Function test - */ - it('Telephony_Sim_SendEnvelopeCmd_Promise_0300', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_SendEnvelopeCmd_Promise_0300'; - try { - await sim.sendEnvelopeCmd(env.SLOTID2, env.STK_CMD); - console.log(`${CASE_NAME} test fail`); - expect().assertFail(); - } catch (error) { - console.log(`${CASE_NAME} SendEnvelopeCmd expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish`); - } - done(); - }); - /** - * @tc.number Telephony_Sim_SendTerminalResponseCmd_Async_0300 - * @tc.name Test SendTerminalResponseCmd async callback interface, enter parameter 2 - * for slotId exception, check the callback value - * @tc.desc Function test - */ - it('Telephony_Sim_SendTerminalResponseCmd_Async_0300', 0, function (done) { - const CASE_NAME = 'Telephony_Sim_SendTerminalResponseCmd_Async_0300'; - sim.sendTerminalResponseCmd(env.SLOTID2, env.STK_CMD, (error) => { - if (error) { - console.log(`${CASE_NAME} SendTerminalResponseCmd expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish`); - done(); - return; - } - console.log(`${CASE_NAME} test fail`); - expect().assertFail(); - done(); - }); - }); - /** - * @tc.number Telephony_Sim_SendTerminalResponseCmd_Promise_0300 - * @tc.name Test SendTerminalResponseCmd promise interface, enter parameter 2 - * for slotId exception, check the callback value - * @tc.desc Function test - */ - it('Telephony_Sim_SendTerminalResponseCmd_Promise_0300', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_SendTerminalResponseCmd_Promise_0300'; - try { - await sim.sendTerminalResponseCmd(env.SLOTID2, env.STK_CMD); - console.log(`${CASE_NAME} test fail`); - expect().assertFail(); - } catch (error) { - console.log(`${CASE_NAME} SendTerminalResponseCmd expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish`); - } - done(); - }); + /** * @tc.number Telephony_Sim_hasOperatorPrivileges_Async_0400 @@ -1716,44 +511,4 @@ describe('SimManagerTest', function () { } done(); }); - - /** - * @tc.number Telephony_Sim_unlockSimLock_Async_2600 - * @tc.name Test the unlocksimLock interface slotId exception into parameter 2, view the callback result - * @tc.desc Function test - */ - it('Telephony_Sim_unlockSimLock_Async_2600', 0, function (done) { - const CASE_NAME = 'Telephony_Sim_unlockSimLock_Async_2600'; - const lockInfo = { lockType: sim.PN_PIN_LOCK, password: env.SIM_PN_PIN_PASSWORD }; - sim.unlockSimLock(env.SLOTID2, lockInfo, (error) => { - if (error) { - console.log(`${CASE_NAME} expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish.`); - done(); - return; - } - expect().assertFail(); - console.log(`${CASE_NAME} test fail.`); - done(); - }); - }); - - /** - * @tc.number Telephony_Sim_unlockSimLock_Promise_2600 - * @tc.name Test the unlocksimLock interface slotId exception into parameter 2, view the return result - * @tc.desc Function test - */ - it('Telephony_Sim_unlockSimLock_Promise_2600', 0, async function (done) { - const CASE_NAME = 'Telephony_Sim_unlockSimLock_Promise_2600'; - const lockInfo = { lockType: sim.PN_PIN_LOCK, password: env.SIM_PN_PIN_PASSWORD }; - try { - await sim.unlockSimLock(env.SLOTID2, lockInfo); - expect().assertFail(); - console.log(`${CASE_NAME} test fail.`); - } catch (error) { - console.log(`${CASE_NAME} expect error: ${error.message}`); - console.log(`${CASE_NAME} test finish.`); - } - done(); - }); -}); \ No newline at end of file +}) 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 0bc888c96989fa46cd32f7039680287c3196f921..ea7bd68f2519038b2bf7f7fbba5ab23313c30c1b 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 @@ -38,337 +38,6 @@ describe('SmsMmsErrorTest', function () { const TRUE_SLOT_ID = 0; const RECEIVE_SMS_PDU = '240D91689141468496F600001270721142432302B319'; - /* - * @tc.number Telephony_SmsMms_addSimMessage_Async_0200 - * @tc.name When SLOTID is the wrong value,Failed to save SMS to SIM - * @tc.desc Function test - */ - it('Telephony_SmsMms_addSimMessage_Async_0200', 0, async function (done) { - let data = { - slotId: FALSE_SLOT_ID, - smsc: '', - pdu: CORRECT_SMS_PDU, - status: sms.SIM_MESSAGE_STATUS_SENT - }; - sms.addSimMessage(data, (err, result) => { - if (err) { - console.log('Telephony_SmsMms_addSimMessage_Async_0200 finish'); - done(); - return; - } - expect().assertFail(); - console.log('Telephony_SmsMms_addSimMessage_Async_0200 fail'); - done(); - }); - }); - - /* - * @tc.number Telephony_SmsMms_addSimMessage_Promise_0200 - * @tc.name When SLOTID is the wrong value,Failed to save SMS to SIM - * @tc.desc Function test - */ - it('Telephony_SmsMms_addSimMessage_Promise_0200', 0, async function (done) { - let data = { - slotId: FALSE_SLOT_ID, - smsc: '', - pdu: CORRECT_SMS_PDU, - status: sms.SIM_MESSAGE_STATUS_SENT - }; - try { - await sms.addSimMessage(data); - expect().assertFail(); - console.log('Telephony_SmsMms_addSimMessage_Promise_0200 fail'); - done(); - } catch (err) { - console.log('Telephony_SmsMms_addSimMessage_Promise_0200 finish'); - done(); - } - }); - - /* - * @tc.number Telephony_SmsMms_addSimMessage_Async_1400 - * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_READ, - * Save a text message to the SIM card - * @tc.desc Function test - */ - it('Telephony_SmsMms_addSimMessage_Async_1400', 0, async function (done) { - let data = { - slotId: TRUE_SLOT_ID, - smsc: '', - pdu: RECEIVE_SMS_PDU, - status: sms.SIM_MESSAGE_STATUS_READ - }; - sms.addSimMessage(data, (addErr) => { - if (addErr) { - console.log('Telephony_SmsMms_addSimMessage_Async_1400 finish'); - done(); - return; - } - console.log('Telephony_SmsMms_addSimMessage_Async_1400 add fail '); - }); - }); - - /* - * @tc.number Telephony_SmsMms_addSimMessage_Promise_1400 - * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_READ, - * Save a text message to the SIM card - * @tc.desc Function test - */ - it('Telephony_SmsMms_addSimMessage_Promise_1400', 0, async function (done) { - let data = { - slotId: TRUE_SLOT_ID, - smsc: '', - pdu: RECEIVE_SMS_PDU, - status: sms.SIM_MESSAGE_STATUS_READ - }; - try { - await sms.addSimMessage(data); - console.log('Telephony_SmsMms_addSimMessage_Promise_1400 fail '); - } catch (err) { - console.log('Telephony_SmsMms_addSimMessage_Promise_1400 addSimMessage finish'); - done(); - } - }); - - /* - * @tc.number Telephony_SmsMms_addSimMessage_Async_1700 - * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_UNSENT,Set the PDU read type - * Description Failed to add SMS messages to the SIM card - * @tc.desc Function test - */ - it('Telephony_SmsMms_addSimMessage_Async_1700', 0, async function (done) { - let data = { - slotId: TRUE_SLOT_ID, - smsc: '', - pdu: RECEIVE_SMS_PDU, - status: sms.SIM_MESSAGE_STATUS_UNSENT - }; - sms.addSimMessage(data, (addErr) => { - if (addErr) { - sms.getAllSimMessages(TRUE_SLOT_ID, (getErr, getResult) => { - if (getErr) { - console.log('Telephony_SmsMms_addSimMessage_Async_1700 getAllSimMessages fail'); - done(); - return; - } - expect(getResult.length == 0).assertTrue(); - console.log('Telephony_SmsMms_addSimMessage_Async_1700 getAllSimMessages getResult.length = ' - + getResult.length); - console.log('Telephony_SmsMms_addSimMessage_Async_1700 getAllSimMessages finish'); - done(); - }); - } else { - console.log('Telephony_SmsMms_addSimMessage_Async_1700 addSimMessage fail'); - done(); - } - }); - }); - - /* - * @tc.number Telephony_SmsMms_addSimMessage_Promise_1700 - * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_UNSENT,Set the PDU read type - * Description Failed to add SMS messages to the SIM card - * @tc.desc Function test - */ - it('Telephony_SmsMms_addSimMessage_Promise_1700', 0, async function (done) { - let data = { - slotId: TRUE_SLOT_ID, - smsc: '', - pdu: RECEIVE_SMS_PDU, - status: sms.SIM_MESSAGE_STATUS_UNSENT - }; - try { - await sms.addSimMessage(data); - console.log('Telephony_SmsMms_addSimMessage_Promise_1700 add fail'); - done(); - return; - } catch (err) { - console.log('Telephony_SmsMms_addSimMessage_Promise_1700 finish '); - done(); - } - }); - - /* - * @tc.number Telephony_SmsMms_addSimMessage_Async_1800 - * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_UNREAD,Set the PDU sending type - * Description Failed to add SMS messages to the SIM card - * @tc.desc Function test - */ - it('Telephony_SmsMms_addSimMessage_Async_1800', 0, async function (done) { - let data = { - slotId: TRUE_SLOT_ID, - smsc: '', - pdu: CORRECT_SMS_PDU, - status: sms.SIM_MESSAGE_STATUS_UNREAD - }; - sms.addSimMessage(data, (addErr) => { - if (addErr) { - sms.getAllSimMessages(TRUE_SLOT_ID, (getErr, getResult) => { - if (getErr) { - console.log('Telephony_SmsMms_addSimMessage_Async_1800 getAllSimMessages fail'); - done(); - return; - } - expect(getResult.length == 0).assertTrue(); - console.log('Telephony_SmsMms_addSimMessage_Async_1800 getAllSimMessages getResult = ' + getResult.length); - console.log('Telephony_SmsMms_addSimMessage_Async_1800 getAllSimMessages finish'); - done(); - }); - } else { - console.log('Telephony_SmsMms_addSimMessage_Async_1800 addSimMessage fail'); - done(); - } - }); - }); - - /* - * @tc.number Telephony_SmsMms_addSimMessage_Promise_1800 - * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_UNREAD,Set the PDU sending type - * Description Failed to add SMS messages to the SIM card - * @tc.desc Function test - */ - it('Telephony_SmsMms_addSimMessage_Promise_1800', 0, async function (done) { - let data = { - slotId: TRUE_SLOT_ID, - smsc: '', - pdu: CORRECT_SMS_PDU, - status: sms.SIM_MESSAGE_STATUS_UNREAD - }; - try { - await sms.addSimMessage(data); - console.log('Telephony_SmsMms_addSimMessage_Promise_1800 add fail'); - done(); - } catch (err) { - console.log('Telephony_SmsMms_addSimMessage_Promise_1800 finish '); - done(); - } - }); - - /** - * @tc.number Telephony_SmsMms_delSimMessage_Async_0200 - * @tc.name When SLOTID is the wrong value,Deletes a text message from the SIM card fail - * @tc.desc Function test - */ - it('Telephony_SmsMms_delSimMessage_Async_0200', 0, async function (done) { - sms.delSimMessage(FALSE_SLOT_ID, 0, (err) => { - if (err) { - console.log('Telephony_SmsMms_delSimMessage_Async_0200 delSimMessage finish'); - done(); - return; - } - expect().assertFail(); - console.log('Telephony_SmsMms_delSimMessage_Async_0200 fail'); - done(); - }); - }); - - /** - * @tc.number Telephony_SmsMms_delSimMessage_Promise_0200 - * @tc.name When SLOTID is the wrong value,Deletes a text message from the SIM card fail - * @tc.desc Function test - */ - it('Telephony_SmsMms_delSimMessage_Promise_0200', 0, async function (done) { - try { - await sms.delSimMessage(FALSE_SLOT_ID, 0); - expect().assertFail(); - console.log('Telephony_SmsMms_delSimMessage_Promise_0200 fail'); - done(); - } catch (err) { - console.log('Telephony_SmsMms_delSimMessage_Promise_0200 finish'); - done(); - } - }); - - /** - * @tc.number Telephony_SmsMms_updateSimMessage_Async_0100 - * @tc.name When SLOTID is the wrong value,Failed to update SIM card SMS record - * @tc.desc Function test - */ - it('Telephony_SmsMms_updateSimMessage_Async_0100', 0, async function (done) { - let upData = { - slotId: FALSE_SLOT_ID, - msgIndex: 0, - newStatus: sms.SIM_MESSAGE_STATUS_SENT, - pdu: CORRECT_SMS_PDU, - smsc: '' - }; - sms.updateSimMessage(upData, (err) => { - if (err) { - console.log('Telephony_SmsMms_updateSimMessage_Async_0100 update finish'); - done(); - return; - } - expect().assertFail(); - console.log('Telephony_SmsMms_updateSimMessage_Async_0100 update fail'); - done(); - }); - }); - - /** - * @tc.number Telephony_SmsMms_updateSimMessage_Promise_0100 - * @tc.name When SLOTID is the wrong value,Failed to update SIM card SMS record - * @tc.desc Function test - */ - it('Telephony_SmsMms_updateSimMessage_Promise_0100', 0, async function (done) { - let upData = { - slotId: FALSE_SLOT_ID, - msgIndex: 0, - newStatus: sms.SIM_MESSAGE_STATUS_SENT, - pdu: CORRECT_SMS_PDU, - smsc: '' - }; - try { - await sms.updateSimMessage(upData); - expect().assertFail(); - console.log('Telephony_SmsMms_updateSimMessage_Promise_0100 fail'); - done(); - return; - } catch (err) { - console.log('Telephony_SmsMms_updateSimMessage_Promise_0100 getAllSimMessages cur finish'); - done(); - } - }); - - /** - * @tc.number Telephony_SmsMms_getAllSIMMessages_Async_0200 - * @tc.name When "SLOTID" is an error value,Failed to query all SMS records for SIM card - * @tc.desc Function test - */ - it('Telephony_SmsMms_getAllSIMMessages_Async_0200', 0, async function (done) { - sms.getAllSimMessages(FALSE_SLOT_ID, (err, result) => { - if (err) { - expect().assertFail(); - console.log('Telephony_SmsMms_getAllSIMMessages_Async_0200 fail'); - 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(); - }); - }); - - /** - * @tc.number Telephony_SmsMms_getAllSIMMessages_Promise_0200 - * @tc.name When "SLOTID" is an error value,Failed to query all SMS records for SIM card - * @tc.desc Function test - */ - it('Telephony_SmsMms_getAllSIMMessages_Promise_0200', 0, async function (done) { - try { - let promise = await sms.getAllSimMessages(FALSE_SLOT_ID); - expect(promise === null || promise === undefined || promise.length === 0).assertTrue(); - console.log('Telephony_SmsMms_getAllSIMMessages_Promise_0200 getAllSimMessages cur finish'); - done(); - } catch (err) { - expect().assertFail(); - console.log('Telephony_SmsMms_getAllSIMMessages_Promise_0200 fail'); - done(); - } - }); /* * @tc.number Telephony_SmsMms_createMessage_Async_0200 @@ -400,36 +69,7 @@ describe('SmsMmsErrorTest', function () { }); }); - /* - * @tc.number Telephony_SmsMms_sendMessage_0200 - * @tc.name Call the interface sendMessage, set the card slot parameter "slotId" to FALSE_SLOT_ID, - * SMS failed to send - * @tc.desc Function test - */ - it('Telephony_SmsMms_sendMessage_0200', 0, async function (done) { - sms.sendMessage({ - slotId: FALSE_SLOT_ID, - destinationHost: SMS_SEND_DST_NUMBER, - serviceCenter: '', - content: 'hello', - destinationPort: 0, - sendCallback: (err, value) => { - if (err) { - expect().assertFail(); - console.log('Telephony_SmsMms_sendMessage_0200 fail'); - done(); - return; - } - 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(); - }, - deliveryCallback: () => {} - }); - }); - + /* * @tc.number Telephony_SmsMms_createMessage_Promise_0200 * @tc.name Call interface CreateMessage, @@ -449,152 +89,7 @@ describe('SmsMmsErrorTest', function () { } }); - /** - * @tc.number Telephony_SmsMms_setSmscAddr_Async_0200 - * @tc.name When "SLOTID" is an error value,Failed to set short message service address - * @tc.desc Function test - */ - it('Telephony_SmsMms_setSmscAddr_Async_0200', 0, async function (done) { - sms.setSmscAddr(FALSE_SLOT_ID, '', (err) => { - if (err) { - console.log('Telephony_SmsMms_setSmscAddr_Async_0200 finish'); - done(); - return; - } - expect().assertFail(); - console.log('Telephony_SmsMms_setSmscAddr_Async_0200 fail'); - done(); - }); - }); - - /** - * @tc.number Telephony_SmsMms_setSmscAddr_Promise_0200 - * @tc.name When "SLOTID" is an error value,Failed to set short message service address - * @tc.desc Function test - */ - it('Telephony_SmsMms_setSmscAddr_Promise_0200', 0, async function (done) { - try { - await sms.setSmscAddr(FALSE_SLOT_ID, ''); - expect().assertFail(); - console.log('Telephony_SmsMms_createMessage_Promise_0200 fail'); - done(); - } catch (err) { - console.log('Telephony_SmsMms_createMessage_Promise_0200 finish '); - done(); - } - }); - - /** - * @tc.number Telephony_SmsMms_getSmscAddr_Async_0200 - * @tc.name When "SLOTID" is an error value,Failed to get SMS service address - * @tc.desc Function test - */ - it('Telephony_SmsMms_getSmscAddr_Async_0200', 0, async function (done) { - sms.getSmscAddr(FALSE_SLOT_ID, (err, getResult) => { - if (err) { - expect().assertFail(); - console.log('Telephony_SmsMms_getSmscAddr_Async_0200 fail'); - done(); - return; - } - expect(getResult === undefined || getResult === ''); - console.log('Telephony_SmsMms_getSmscAddr_Async_0200 finish'); - done(); - }); - }); - - /** - * @tc.number Telephony_SmsMms_getSmscAddr_Promise_0200 - * @tc.name When "SLOTID" is an error value,Failed to get SMS service address - * @tc.desc Function test - */ - it('Telephony_SmsMms_getSmscAddr_Promise_0200', 0, async function (done) { - try { - let promise = await sms.getSmscAddr(FALSE_SLOT_ID); - expect(promise === undefined || promise === ''); - console.log('Telephony_SmsMms_getSmscAddr_Promise_0200 finish'); - done(); - } catch (err) { - console.log('Telephony_SmsMms_getSmscAddr_Promise_0200 fail'); - expect().assertFail(); - done(); - } - }); - - /* - * @tc.number Telephony_SmsMms_getSmsSegmentsInfo_Async_2000 - * @tc.name The passed argument is an error slotId, view the results - * @tc.desc Function test - */ - it('Telephony_SmsMms_getSmsSegmentsInfo_Async_2000', 0, async function (done) { - let message = ''; - for (let index = 0;index < MAX_CHINESE_MESSAGE_LENTH + 1;index++) { - message += '中'; - } - sms.getSmsSegmentsInfo(FALSE_SLOT_ID, message, true, (error, result) => { - if (error) { - console.log("Telephony_SmsMms_getSmsSegmentsInfo_Async_2000 getSmsSegmentsInfo error " + error.message); - console.log('Telephony_SmsMms_getSmsSegmentsInfo_Async_2000 finish'); - } else { - expect().assertFail(); - console.log('Telephony_SmsMms_getSmsSegmentsInfo_Async_2000 fail'); - } - done(); - }); - }); - - /* - * @tc.number Telephony_SmsMms_getSmsSegmentsInfo_Promise_2000 - * @tc.name The passed argument is an error slotId, view the results - * @tc.desc Function test - */ - it('Telephony_SmsMms_getSmsSegmentsInfo_Promise_2000', 0, async function (done) { - let message = ''; - for (let index = 0;index < MAX_MESSAGE_LENTH;index++) { - message += 'a'; - } - try { - let result = await sms.getSmsSegmentsInfo(FALSE_SLOT_ID, message, true); - console.log('Telephony_SmsMms_getSmsSegmentsInfo_Promise_2000 fail'); - expect().assertFail(); - } catch (err) { - console.log('Telephony_SmsMms_getSmsSegmentsInfo_Promise_2000 finish'); - } - done(); - }); - - /* - * @tc.number Telephony_SmsMms_isImsSmsSupported_Async_0100 - * @tc.name Check whether the Ims SMS function is supported - * @tc.desc Function test - */ - it('Telephony_SmsMms_isImsSmsSupported_Async_0100', 0, async function (done) { - sms.isImsSmsSupported((error, result) => { - if (error) { - console.log('Telephony_SmsMms_isImsSmsSupported_Async_0100 fail'); - } else { - expect(result === false || result === true).assertTrue(); - console.log('Telephony_SmsMms_isImsSmsSupported_Async_0100 finish'); - } - done(); - }); - }); - /* - * @tc.number Telephony_SmsMms_isImsSmsSupported_Promise_0100 - * @tc.name Check whether the Ims SMS function is supported - * @tc.desc Function test - */ - it('Telephony_SmsMms_isImsSmsSupported_Promise_0100', 0, async function (done) { - try { - let result = await sms.isImsSmsSupported(); - expect(result === false || result === true).assertTrue(); - console.log('Telephony_SmsMms_isImsSmsSupported_Promise_0100 finish'); - } catch (err) { - console.log('Telephony_SmsMms_isImsSmsSupported_Promise_0100 fail'); - } - done(); - }); /* * @tc.number Telephony_SmsMms_hasSmsCapability_0100 @@ -608,279 +103,6 @@ describe('SmsMmsErrorTest', function () { done(); }); - /* - * @tc.number Telephony_SmsMms_getImsShortMessageFormat_Async_0100 - * @tc.name call the interface to obtain SMS system - * @tc.desc Function test - */ - it('Telephony_SmsMms_getImsShortMessageFormat_Async_0100', 0, async function (done) { - sms.getImsShortMessageFormat((error, result) => { - if (error) { - console.log('Telephony_SmsMms_getImsShortMessageFormat_Async_0100 fail'); - expect().assertFail(); - } else { - expect(result === undefined || result === '').assertTrue(); - console.log('Telephony_SmsMms_getImsShortMessageFormat_Async_0100 result = ' + result); - console.log('Telephony_SmsMms_getImsShortMessageFormat_Async_0100 finish'); - } - done(); - }); - }); - - /* - * @tc.number Telephony_SmsMms_getImsShortMessageFormat_Promise_0100 - * @tc.name call the interface to obtain SMS system - * @tc.desc Function test - */ - it('Telephony_SmsMms_getImsShortMessageFormat_Promise_0100', 0, async function (done) { - try { - let result = await sms.getImsShortMessageFormat(); - expect(result === undefined || result === '').assertTrue(); - console.log('Telephony_SmsMms_getImsShortMessageFormat_Async_0100 result = ' + result); - console.log('Telephony_SmsMms_getImsShortMessageFormat_Promise_0100 finish'); - } catch (err) { - expect().assertFail(); - console.log('Telephony_SmsMms_getImsShortMessageFormat_Promise_0100 fail'); - } - done(); - }); - - /* - * @tc.number Telephony_SmsMms_splitMessage_Async_1600 - * @tc.name Call the interface, set message to empty, and see the result - * @tc.desc Function test - */ - it('Telephony_SmsMms_splitMessage_Async_1600', 0, async function (done) { - let message = ''; - sms.splitMessage(message, (error, result) => { - if (error) { - console.log("Telephony_SmsMms_splitMessage_Async_1600 splitMessage on error because " + error.message); - console.log('Telephony_SmsMms_splitMessage_Async_1600 fail'); - } else { - console.log("Telephony_SmsMms_splitMessage_Async_1600 splitMessage on value = " + JSON.stringify(result)); - expect(result === undefined || result.length === 0).assertTrue(); - console.log('Telephony_SmsMms_splitMessage_Async_1600 finish'); - } - done(); - }); - }); - - /* - * @tc.number Telephony_SmsMms_splitMessage_Promise_1600 - * @tc.name Call the interface, set message to empty, and see the result - * @tc.desc Function test - */ - it('Telephony_SmsMms_splitMessage_Promise_1600', 0, async function (done) { - let message = ''; - try { - let result = await sms.splitMessage(message); - console.log('Telephony_SmsMms_splitMessage_Promise_1600 finish'); - expect(result === undefined || result.length === 0).assertTrue(); - } catch (err) { - console.log('Telephony_SmsMms_splitMessage_Promise_1600 fail'); - } - done(); - }); - - /** - * @tc.number Telephony_SmsMms_decodeMms_Async_1000 - * @tc.name Passing in the exception path, Parse failure - * @tc.desc Function test - */ - it('Telephony_SmsMms_decodeMms_Async_1000', 0, async function (done) { - sms.decodeMms(eorroMessagePath, (err, data) => { - if (err) { - console.log('Telephony_SmsMms_decodeMms_Async_1000 finish'); - done(); - return; - } - expect().assertFail(); - console.log('Telephony_SmsMms_decodeMms_Async_1000 fail'); - done(); - }); - }); - - /** - * @tc.number Telephony_SmsMms_decodeMms_Promise_1000 - * @tc.name Passing in the exception path, Parse failure - * @tc.desc Function test - */ - it('Telephony_SmsMms_decodeMms_Promise_1000', 0, async function (done) { - try { - await sms.decodeMms(eorroMessagePath); - console.log('Telephony_SmsMms_decodeMms_Promise_1000 fail'); - expect().assertFail(); - done(); - } catch (err) { - console.log('Telephony_SmsMms_decodeMms_Promise_1000 finish'); - done(); - } - }); - - /** - * @tc.number Telephony_SmsMms_encodeMms_Async_0900 - * @tc.name ReadOrigInd type MMS, encoding after decoding, the content after decoding and coding before the same - * @tc.desc Function test - */ - it('Telephony_SmsMms_encodeMms_Async_0900', 0, async function (done) { - let mmsType = { - version: sms.MMS_VERSION_1_1, - messageId: "0001", - to: [{address: "+861388888****/TYPE=PLMN", charset: sms.UTF_8}], - "from": {address: "+861381234****/TYPE=PLMN", charset: sms.UTF_8}, - readStatus: 129, - date: 1639378126, - }; - sms.encodeMms({messageType: sms.TYPE_MMS_READ_ORIG_IND, mmsType}, (err, encodeData) =>{ - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0900 encodeMms fail'); - done(); - return; - } - console.log('Telephony_SmsMms_encodeMms_Async_0900 encodeMms finish'); - sms.decodeMms(encodeData, (err, data) => { - if (err) { - console.log('Telephony_SmsMms_encodeMms_Async_0900 fail'); - done(); - return; - } - expect(data.messageType === sms.TYPE_MMS_READ_ORIG_IND).assertTrue(); - expect(data.mmsType.version === sms.MMS_VERSION_1_1).assertTrue(); - expect(data.mmsType.messageId === '0001').assertTrue(); - expect(data.mmsType.to.length > 0).assertTrue(); - expect(data.mmsType.to[0].address.length > 0).assertTrue(); - expect(data.mmsType.to[0].charset === sms.UTF_8).assertTrue(); - expect(data.mmsType.from.address.length > 0).assertTrue(); - expect(data.mmsType.from.charset === sms.UTF_8).assertTrue(); - expect(data.mmsType.date > 0).assertTrue(); - expect(data.mmsType.readStatus === 129).assertTrue(); - console.log('Telephony_SmsMms_encodeMms_Async_0900 finish'); - done(); - }); - }); - }); - - /** - * @tc.number Telephony_SmsMms_encodeMms_Promise_0900 - * @tc.name ReadOrigInd type MMS, encoding after decoding, the content after decoding and coding before the same - * @tc.desc Function test - */ - it('Telephony_SmsMms_encodeMms_Promise_0900', 0, async function (done) { - let mmsType = { - version: sms.MMS_VERSION_1_1, - messageId: "0001", - to: [{address: "+861388888****/TYPE=PLMN", charset: sms.UTF_8}], - "from": {address: "+861381234****/TYPE=PLMN", charset: sms.UTF_8}, - date: 1639378126, - readStatus: 129, - }; - try { - let encodePromise = await sms.encodeMms({messageType: sms.TYPE_MMS_READ_ORIG_IND, mmsType}); - expect(encodePromise.length > 0).assertTrue(); - console.log('Telephony_SmsMms_encodeMms_Promise_0900 encodeMms finish'); - let promise = await sms.decodeMms(encodePromise); - expect(promise.messageType === sms.TYPE_MMS_READ_ORIG_IND).assertTrue(); - expect(promise.mmsType.version === sms.MMS_VERSION_1_1).assertTrue(); - expect(promise.mmsType.messageId === '0001').assertTrue(); - expect(promise.mmsType.to.length > 0).assertTrue(); - expect(promise.mmsType.to[0].address.length > 0).assertTrue(); - expect(promise.mmsType.to[0].charset === sms.UTF_8).assertTrue(); - expect(promise.mmsType.from.address.length > 0).assertTrue(); - expect(promise.mmsType.from.charset === sms.UTF_8).assertTrue(); - expect(promise.mmsType.date > 0).assertTrue(); - expect(promise.mmsType.readStatus === 129).assertTrue(); - console.log('Telephony_SmsMms_decodeMms_Promise_0900 finish'); - done(); - } catch (err) { - console.log('Telephony_SmsMms_decodeMms_Promise_0900 fail'); - done(); - } - }); - - /** - * @tc.number Telephony_SmsMms_setCBConfig_Async_0600 - * @tc.name When "SLOTID" is an error value,Failed to set up cell broadcast - * @tc.desc Function test - */ - it('Telephony_SmsMms_setCBConfig_Async_0600', 0, async function (done) { - let data = { - slotId: FALSE_SLOT_ID, - enable: true, - startMessageId: IDENTIFIER_MIN, - endMessageId: IDENTIFIER_MAX, - ranType: RANTYPE_GSM - }; - sms.setCBConfig(data, (err) => { - if (err) { - console.log(`Telephony_SmsMms_setCBConfig_Async_0600 finish err : ${err.message}`); - done(); - return; - } - expect().assertFail(); - console.log('Telephony_SmsMms_setCBConfig_Async_0600 fail'); - done(); - }); - }); - - /** - * @tc.number Telephony_SmsMms_setCBConfig_Promise_0600 - * @tc.name When "SLOTID" is an error value,Failed to set up cell broadcast - * @tc.desc Function test - */ - it('Telephony_SmsMms_setCBConfig_Promise_0600', 0, async function (done) { - let data = { - slotId: FALSE_SLOT_ID, - enable: true, - startMessageId: IDENTIFIER_MIN, - endMessageId: IDENTIFIER_MAX, - ranType: RANTYPE_GSM - }; - try { - await sms.setCBConfig(data); - expect().assertFail(); - console.log('Telephony_SmsMms_setCBConfig_Promise_0600 fail'); - done(); - } catch (err) { - console.log('Telephony_SmsMms_setCBConfig_Promise_0600 finish'); - done(); - } - }); - - /** - * @tc.number Telephony_SmsMms_setDefaultSmsSlotId_Async_0200 - * @tc.name The default card slot ID is set to an error value,Failed to set send SMS card slot ID - * @tc.desc Function test - */ - it('Telephony_SmsMms_setDefaultSmsSlotId_Async_0200', 0, async function (done) { - sms.setDefaultSmsSlotId(FALSE_SLOT_ID, (err) => { - if (err) { - console.log('Telephony_SmsMms_setDefaultSmsSlotId_Async_0200 finish'); - done(); - return; - } - expect().assertFail(); - console.log('Telephony_SmsMms_setDefaultSmsSlotId_Async_0200 fail'); - done(); - }); - }); - - /** - * @tc.number Telephony_SmsMms_setDefaultSmsSlotId_Promise_0200 - * @tc.name The default card slot ID is set to an error value,Failed to set send SMS card slot ID - * @tc.desc Function test - */ - it('Telephony_SmsMms_setDefaultSmsSlotId_Promise_0200', 0, async function (done) { - try { - await sms.setDefaultSmsSlotId(FALSE_SLOT_ID); - expect().assertFail(); - console.log('Telephony_SmsMms_setDefaultSmsSlotId_Promise_0200 fail'); - done(); - return; - } catch (err) { - console.log('Telephony_SmsMms_setDefaultSmsSlotId_Promise_0200 finish'); - done(); - } - }); /** * @tc.number Telephony_SmsMms_getDefaultSmsSlotId_Async_0100