未验证 提交 eaa01f8e 编写于 作者: O openharmony_ci 提交者: Gitee

!9406 增加sim卡判断

Merge pull request !9406 from 姜欢欢/master
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
import { describe, expect, it } from '@ohos/hypium'; import { describe, expect, it } from '@ohos/hypium';
import sms from '@ohos.telephony.sms'; import sms from '@ohos.telephony.sms';
import radio from '@ohos.telephony.radio'; import radio from '@ohos.telephony.radio';
import sim from '@ohos.telephony.sim';
export default function smsUiJsunit() { export default function smsUiJsunit() {
describe('smsUiJsunit', function () { describe('smsUiJsunit', function () {
...@@ -122,50 +123,46 @@ export default function smsUiJsunit() { ...@@ -122,50 +123,46 @@ export default function smsUiJsunit() {
done(); done();
}); });
/** /**
* @tc.number Telephony_Sms_getDefaultSmsSimId_CallBack_0100 * @tc.number Telephony_Sms_getDefaultSmsSimId_CallBack_0100
* @tc.name Test getOpName interface * @tc.name Test getOpName interface
* @tc.desc * @tc.desc
*/ */
it('Telephony_Sms_getDefaultSmsSimId_CallBack_0100', 0, async function (done) { it('Telephony_Sms_getDefaultSmsSimId_CallBack_0100', 0, async function (done) {
sms.getDefaultSmsSimId((err, data) => { sms.getDefaultSmsSimId((err, data) => {
if(err){ if(err){
console.info("Telephony_Sms_getDefaultSmsSimId_CallBack_0100 err = " + JSON.stringify(data)); console.info("Telephony_Sms_getDefaultSmsSimId_CallBack_0100 err = " + JSON.stringify(data));
radio.isRadioOn(0, (err, data) => { expect(true).assertTrue();
console.info('Telephony_Sms_getDefaultSmsSimId_CallBack_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data)); done();
if (!err) { return;
expect().assertFail(); }
} console.log(`Telephony_Sms_getDefaultSmsSimId_CallBack_0100 callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sim.hasSimCard(0, (err, data) => {
console.log(`Telephony_Sms_getDefaultSmsSimId_CallBack_0100 hasSimCard callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
expect(data).assertTrue();
done();
}); });
done(); });
return;
}
console.log(`Telephony_Sms_getDefaultSmsSimId_CallBack_0100 callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
expect(true).assertTrue();
done();
}); });
}); /**
/** * @tc.number Telephony_Sms_getDefaultSmsSimId_Promise_0100
* @tc.number Telephony_Sms_getDefaultSmsSimId_Promise_0100 * @tc.name Test getOpName interface
* @tc.name Test getOpName interface * @tc.desc
* @tc.desc */
*/ it('Telephony_Sms_getDefaultSmsSimId_Promise_0100', 0, async function (done) {
it('Telephony_Sms_getDefaultSmsSimId_Promise_0100', 0, async function (done) { let promise = sms.getDefaultSmsSimId();
let promise = sms.getDefaultSmsSimId(); promise.then(data => {
promise.then(data => {
console.info("Telephony_Sms_getDefaultSmsSimId_Promise_0100 data = " + JSON.stringify(data)); console.info("Telephony_Sms_getDefaultSmsSimId_Promise_0100 data = " + JSON.stringify(data));
expect(true).assertTrue(); sim.hasSimCard(0, (err, data) => {
done(); console.log(`Telephony_Sms_getDefaultSmsSimId_Promise_0100 hasSimCard callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
}).catch(err => { expect(data).assertTrue();
console.info("Telephony_Sms_getDefaultSmsSimId_Promise_0100 err = " + JSON.stringify(err)); done();
radio.isRadioOn(0, (err, data) => {
console.info('Telephony_Sms_getDefaultSmsSimId_Promise_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data));
if (!err) {
expect().assertFail();
}
}); });
}).catch(err => {
console.info("Telephony_Sms_getDefaultSmsSimId_Promise_0100 err = " + JSON.stringify(err));
expect(true).assertTrue();
done(); done();
});
}); });
});
}) })
} }
...@@ -19,39 +19,39 @@ import * as env from './lib/Const'; ...@@ -19,39 +19,39 @@ import * as env from './lib/Const';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
export default function SimManagerTest() { export default function SimManagerTest() {
describe('SimManagerTest', function () { describe('SimManagerTest', function () {
afterEach(async function () { afterEach(async function () {
try { try {
class IccAccountInfo { class IccAccountInfo {
constructor (slotIndex, showName, showNumber) { constructor (slotIndex, showName, showNumber) {
this.slotIndex = slotIndex; this.slotIndex = slotIndex;
this.showName = showName; this.showName = showName;
this.showNumber = showNumber; this.showNumber = showNumber;
}
} }
} const SLOT_INDEX = 0;
const SLOT_INDEX = 0; const SHOW_NAME = 'test';
const SHOW_NAME = 'test'; const SHOW_NUMBER = '10';
const SHOW_NUMBER = '10'; let iccAccountInfo = new IccAccountInfo(SLOT_INDEX, SHOW_NAME, SHOW_NUMBER);
let iccAccountInfo = new IccAccountInfo(SLOT_INDEX, SHOW_NAME, SHOW_NUMBER); expect(iccAccountInfo.slotIndex === SLOT_INDEX).assertTrue();
expect(iccAccountInfo.slotIndex === SLOT_INDEX).assertTrue(); expect(iccAccountInfo.showName === SHOW_NAME).assertTrue();
expect(iccAccountInfo.showName === SHOW_NAME).assertTrue(); expect(iccAccountInfo.showNumber === SHOW_NUMBER).assertTrue();
expect(iccAccountInfo.showNumber === SHOW_NUMBER).assertTrue();
class LockStatusResponse { class LockStatusResponse {
constructor (result, remain) { constructor (result, remain) {
this.result = result; this.result = result;
this.remain = remain; this.remain = remain;
}
} }
const RES_RESULT = 0;
const RES_REMAIN = 0;
let lockStatusResponse = new LockStatusResponse(RES_RESULT, RES_REMAIN);
expect(lockStatusResponse.result === RES_RESULT).assertTrue();
expect(lockStatusResponse.remain === RES_REMAIN).assertTrue();
} catch (error) {
console.info(`Telephony_Sim error`);
} }
const RES_RESULT = 0; });
const RES_REMAIN = 0;
let lockStatusResponse = new LockStatusResponse(RES_RESULT, RES_REMAIN);
expect(lockStatusResponse.result === RES_RESULT).assertTrue();
expect(lockStatusResponse.remain === RES_REMAIN).assertTrue();
} catch (error) {
console.info(`Telephony_Sim error`);
}
});
it('Telephony_Sim_getDefaultVoiceSlotId_0100', 0, async function (done) { it('Telephony_Sim_getDefaultVoiceSlotId_0100', 0, async function (done) {
sim.getDefaultVoiceSlotId((err, data) => { sim.getDefaultVoiceSlotId((err, data) => {
...@@ -71,43 +71,65 @@ describe('SimManagerTest', function () { ...@@ -71,43 +71,65 @@ describe('SimManagerTest', function () {
}); });
}); });
/** /**
* @tc.number Telephony_Sim_constantValidate_0100 * @tc.number Telephony_Sim_constantValidate_0100
* @tc.name SIM card constant validation * @tc.name SIM card constant validation
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_constantValidate_0100', 0, async function (done) { it('Telephony_Sim_constantValidate_0100', 0, async function (done) {
console.info(`Telephony_Sim_constantValidate_0100 start`); console.info(`Telephony_Sim_constantValidate_0100 start`);
expect(sim.SimState.SIM_STATE_UNKNOWN !== env.INVALID_VALUE).assertTrue(); expect(sim.SimState.SIM_STATE_UNKNOWN !== env.INVALID_VALUE).assertTrue();
expect(sim.SimState.SIM_STATE_NOT_PRESENT !== env.INVALID_VALUE).assertTrue(); expect(sim.SimState.SIM_STATE_NOT_PRESENT !== env.INVALID_VALUE).assertTrue();
expect(sim.SimState.SIM_STATE_LOCKED !== env.INVALID_VALUE).assertTrue(); expect(sim.SimState.SIM_STATE_LOCKED !== env.INVALID_VALUE).assertTrue();
expect(sim.SimState.SIM_STATE_NOT_READY !== env.INVALID_VALUE).assertTrue(); expect(sim.SimState.SIM_STATE_NOT_READY !== env.INVALID_VALUE).assertTrue();
expect(sim.SimState.SIM_STATE_READY !== env.INVALID_VALUE).assertTrue(); expect(sim.SimState.SIM_STATE_READY !== env.INVALID_VALUE).assertTrue();
expect(sim.SimState.SIM_STATE_LOADED !== env.INVALID_VALUE).assertTrue(); expect(sim.SimState.SIM_STATE_LOADED !== env.INVALID_VALUE).assertTrue();
expect(sim.UNKNOWN_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.UNKNOWN_CARD !== env.INVALID_VALUE).assertTrue();
expect(sim.SINGLE_MODE_SIM_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.SINGLE_MODE_SIM_CARD !== env.INVALID_VALUE).assertTrue();
expect(sim.SINGLE_MODE_USIM_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.SINGLE_MODE_USIM_CARD !== env.INVALID_VALUE).assertTrue();
expect(sim.SINGLE_MODE_RUIM_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.SINGLE_MODE_RUIM_CARD !== env.INVALID_VALUE).assertTrue();
expect(sim.DUAL_MODE_CG_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.DUAL_MODE_CG_CARD !== env.INVALID_VALUE).assertTrue();
expect(sim.CT_NATIONAL_ROAMING_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.CT_NATIONAL_ROAMING_CARD !== env.INVALID_VALUE).assertTrue();
expect(sim.CU_DUAL_MODE_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.CU_DUAL_MODE_CARD !== env.INVALID_VALUE).assertTrue();
expect(sim.DUAL_MODE_TELECOM_LTE_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.DUAL_MODE_TELECOM_LTE_CARD !== env.INVALID_VALUE).assertTrue();
expect(sim.DUAL_MODE_UG_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.DUAL_MODE_UG_CARD !== env.INVALID_VALUE).assertTrue();
expect(sim.SINGLE_MODE_ISIM_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.SINGLE_MODE_ISIM_CARD !== env.INVALID_VALUE).assertTrue();
console.info(`Telephony_Sim_constantValidate_0100 finish`); console.info(`Telephony_Sim_constantValidate_0100 finish`);
done();
});
/**
* @tc.number Telephony_Sim_getISOCountryCodeForSim_Async_0200
* @tc.name Enter exception parameters to test whether the getISOCountryCodeForSim interface function
* can execute normally.
* @tc.desc Function test
*/
it('Telephony_Sim_getISOCountryCodeForSim_Async_0200', 0, async function (done) {
const CASE_NAME = 'Telephony_Sim_getISOCountryCodeForSim_Async_0200';
sim.getISOCountryCodeForSim(env.SLOTID2, (err, data) => {
if (err) {
console.info(`${CASE_NAME} expect err: ${err.message}`);
console.info(`${CASE_NAME} finish`);
done();
return;
}
expect().assertFail();
console.info(`${CASE_NAME} fail, data = ${data}`);
done(); done();
});
}); });
/** /**
* @tc.number Telephony_Sim_getISOCountryCodeForSim_Async_0200 * @tc.number Telephony_Sim_getISOCountryCodeForSim_Promise_0200
* @tc.name Enter exception parameters to test whether the getISOCountryCodeForSim interface function * @tc.name Enter exception parameters to test whether the getISOCountryCodeForSim interface function
* can execute normally. * can execute normally.
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_getISOCountryCodeForSim_Async_0200', 0, async function (done) { it('Telephony_Sim_getISOCountryCodeForSim_Promise_0200', 0, async function (done) {
const CASE_NAME = 'Telephony_Sim_getISOCountryCodeForSim_Async_0200'; const CASE_NAME = 'Telephony_Sim_getISOCountryCodeForSim_Promise_0200';
sim.getISOCountryCodeForSim(env.SLOTID2, (err, data) => { try {
if (err) { var data = await sim.getISOCountryCodeForSim(env.SLOTID2);
} catch (err) {
console.info(`${CASE_NAME} expect err: ${err.message}`); console.info(`${CASE_NAME} expect err: ${err.message}`);
console.info(`${CASE_NAME} finish`); console.info(`${CASE_NAME} finish`);
done(); done();
...@@ -117,39 +139,39 @@ describe('SimManagerTest', function () { ...@@ -117,39 +139,39 @@ describe('SimManagerTest', function () {
console.info(`${CASE_NAME} fail, data = ${data}`); console.info(`${CASE_NAME} fail, data = ${data}`);
done(); done();
}); });
});
/** /**
* @tc.number Telephony_Sim_getISOCountryCodeForSim_Promise_0200 * @tc.number Telephony_Sim_getSimOperatorNumeric_Async_0200
* @tc.name Enter exception parameters to test whether the getISOCountryCodeForSim interface function * @tc.name Enter exception parameters to test whether the getSimOperatorNumeric interface function
* can execute normally. * can execute normally.
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_getISOCountryCodeForSim_Promise_0200', 0, async function (done) { it('Telephony_Sim_getSimOperatorNumeric_Async_0200', 0, async function (done) {
const CASE_NAME = 'Telephony_Sim_getISOCountryCodeForSim_Promise_0200'; const CASE_NAME = 'Telephony_Sim_getSimOperatorNumeric_Async_0200';
try { sim.getSimOperatorNumeric(env.SLOTID2, (err, data) => {
var data = await sim.getISOCountryCodeForSim(env.SLOTID2); if (err) {
} catch (err) { console.info(`${CASE_NAME} expect err: ${err.message}`);
console.info(`${CASE_NAME} expect err: ${err.message}`); console.info(`${CASE_NAME} finish`);
console.info(`${CASE_NAME} finish`); done();
done(); return;
return; }
} expect().assertFail();
expect().assertFail(); console.info(`${CASE_NAME} fail, data = ${data}`);
console.info(`${CASE_NAME} fail, data = ${data}`); done();
done(); });
}); });
/** /**
* @tc.number Telephony_Sim_getSimOperatorNumeric_Async_0200 * @tc.number Telephony_Sim_getSimOperatorNumeric_Promise_0200
* @tc.name Enter exception parameters to test whether the getSimOperatorNumeric interface function * @tc.name Enter exception parameters to test whether the getSimOperatorNumeric interface function
* can execute normally. * can execute normally.
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_getSimOperatorNumeric_Async_0200', 0, async function (done) { it('Telephony_Sim_getSimOperatorNumeric_Promise_0200', 0, async function (done) {
const CASE_NAME = 'Telephony_Sim_getSimOperatorNumeric_Async_0200'; const CASE_NAME = 'Telephony_Sim_getSimOperatorNumeric_Promise_0200';
sim.getSimOperatorNumeric(env.SLOTID2, (err, data) => { try {
if (err) { var data = await sim.getSimOperatorNumeric(env.SLOTID2);
} catch (err) {
console.info(`${CASE_NAME} expect err: ${err.message}`); console.info(`${CASE_NAME} expect err: ${err.message}`);
console.info(`${CASE_NAME} finish`); console.info(`${CASE_NAME} finish`);
done(); done();
...@@ -159,39 +181,38 @@ describe('SimManagerTest', function () { ...@@ -159,39 +181,38 @@ describe('SimManagerTest', function () {
console.info(`${CASE_NAME} fail, data = ${data}`); console.info(`${CASE_NAME} fail, data = ${data}`);
done(); done();
}); });
});
/** /**
* @tc.number Telephony_Sim_getSimOperatorNumeric_Promise_0200 * @tc.number Telephony_Sim_getSimSpn_Async_0200
* @tc.name Enter exception parameters to test whether the getSimOperatorNumeric interface function * @tc.name Enter exception parameters to test whether the getSimSpn interface function can execute normally.
* can execute normally. * @tc.desc Function test
* @tc.desc Function test */
*/ it('Telephony_Sim_getSimSpn_Async_0200', 0, async function (done) {
it('Telephony_Sim_getSimOperatorNumeric_Promise_0200', 0, async function (done) { const CASE_NAME = 'Telephony_Sim_getSimSpn_Async_0200';
const CASE_NAME = 'Telephony_Sim_getSimOperatorNumeric_Promise_0200'; sim.getSimSpn(env.SLOTID2, (err, data) => {
try { if (err) {
var data = await sim.getSimOperatorNumeric(env.SLOTID2); console.info(`${CASE_NAME} fail: ${err.message}`);
} catch (err) { console.info(`${CASE_NAME} finish`);
console.info(`${CASE_NAME} expect err: ${err.message}`); done();
console.info(`${CASE_NAME} finish`); return;
done(); }
return; expect().assertFail();
} console.info(`${CASE_NAME} fail, data = ${data}`);
expect().assertFail(); done();
console.info(`${CASE_NAME} fail, data = ${data}`); });
done(); });
});
/** /**
* @tc.number Telephony_Sim_getSimSpn_Async_0200 * @tc.number Telephony_Sim_getSimSpn_Promise_0200
* @tc.name Enter exception parameters to test whether the getSimSpn interface function can execute normally. * @tc.name Enter exception parameters to test whether the getSimSpn interface function can execute normally.
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_getSimSpn_Async_0200', 0, async function (done) { it('Telephony_Sim_getSimSpn_Promise_0200', 0, async function (done) {
const CASE_NAME = 'Telephony_Sim_getSimSpn_Async_0200'; const CASE_NAME = 'Telephony_Sim_getSimSpn_Promise_0200';
sim.getSimSpn(env.SLOTID2, (err, data) => { try {
if (err) { var data = await sim.getSimSpn(env.SLOTID2);
console.info(`${CASE_NAME} fail: ${err.message}`); } catch (err) {
console.info(`${CASE_NAME} expect err: ${err.message}`);
console.info(`${CASE_NAME} finish`); console.info(`${CASE_NAME} finish`);
done(); done();
return; return;
...@@ -200,37 +221,37 @@ describe('SimManagerTest', function () { ...@@ -200,37 +221,37 @@ describe('SimManagerTest', function () {
console.info(`${CASE_NAME} fail, data = ${data}`); console.info(`${CASE_NAME} fail, data = ${data}`);
done(); done();
}); });
});
/** /**
* @tc.number Telephony_Sim_getSimSpn_Promise_0200 * @tc.number Telephony_Sim_getSimState_Async_0200
* @tc.name Enter exception parameters to test whether the getSimSpn interface function can execute normally. * @tc.name Enter exception parameters to test whether the getSimState interface function can execute normally.
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_getSimSpn_Promise_0200', 0, async function (done) { it('Telephony_Sim_getSimState_Async_0200', 0, async function (done) {
const CASE_NAME = 'Telephony_Sim_getSimSpn_Promise_0200'; sim.getSimState(env.SLOTID2, (err, data) => {
try { const CASE_NAME = 'Telephony_Sim_getSimState_Async_0200';
var data = await sim.getSimSpn(env.SLOTID2); if (err) {
} catch (err) { console.info(`${CASE_NAME} expect err: ${err.message}`);
console.info(`${CASE_NAME} expect err: ${err.message}`); console.info(`${CASE_NAME} finish`);
console.info(`${CASE_NAME} finish`); done();
done(); return;
return; }
} expect().assertFail();
expect().assertFail(); console.info(`${CASE_NAME} fail, data = ${data}`);
console.info(`${CASE_NAME} fail, data = ${data}`); done();
done(); });
}); });
/** /**
* @tc.number Telephony_Sim_getSimState_Async_0200 * @tc.number Telephony_Sim_getSimState_Promise_0200
* @tc.name Enter exception parameters to test whether the getSimState interface function can execute normally. * @tc.name Enter exception parameters to test whether the getSimState interface function can execute normally.
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_getSimState_Async_0200', 0, async function (done) { it('Telephony_Sim_getSimState_Promise_0200', 0, async function (done) {
sim.getSimState(env.SLOTID2, (err, data) => { const CASE_NAME = 'Telephony_Sim_getSimState_Promise_0200';
const CASE_NAME = 'Telephony_Sim_getSimState_Async_0200'; try {
if (err) { var data = await sim.getSimState(env.SLOTID2);
} catch (err) {
console.info(`${CASE_NAME} expect err: ${err.message}`); console.info(`${CASE_NAME} expect err: ${err.message}`);
console.info(`${CASE_NAME} finish`); console.info(`${CASE_NAME} finish`);
done(); done();
...@@ -240,401 +261,365 @@ describe('SimManagerTest', function () { ...@@ -240,401 +261,365 @@ describe('SimManagerTest', function () {
console.info(`${CASE_NAME} fail, data = ${data}`); console.info(`${CASE_NAME} fail, data = ${data}`);
done(); done();
}); });
});
/**
* @tc.number Telephony_Sim_getSimState_Promise_0200
* @tc.name Enter exception parameters to test whether the getSimState interface function can execute normally.
* @tc.desc Function test
*/
it('Telephony_Sim_getSimState_Promise_0200', 0, async function (done) {
const CASE_NAME = 'Telephony_Sim_getSimState_Promise_0200';
try {
var data = await sim.getSimState(env.SLOTID2);
} catch (err) {
console.info(`${CASE_NAME} expect err: ${err.message}`);
console.info(`${CASE_NAME} finish`);
done();
return;
}
expect().assertFail();
console.info(`${CASE_NAME} fail, data = ${data}`);
done();
});
/** /**
* @tc.number Telephony_Sim_isSimActive_Async_0700 * @tc.number Telephony_Sim_isSimActive_Async_0700
* @tc.name Test the slotId exception input parameter 2 during isSimActive interface card activation, * @tc.name Test the slotId exception input parameter 2 during isSimActive interface card activation,
* check the callback value, and expect the callback result flase * check the callback value, and expect the callback result flase
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_isSimActive_Async_0700', 0, async function (done) { it('Telephony_Sim_isSimActive_Async_0700', 0, async function (done) {
sim.isSimActive(env.SLOTID2, (err, data) => { sim.isSimActive(env.SLOTID2, (err, data) => {
console.info("isSimActive async err info :" + JSON.stringify(err) + "data:" + JSON.stringify(data)); console.info("isSimActive async err info :" + JSON.stringify(err) + "data:" + JSON.stringify(data));
expect(err.code).assertEqual(8300001); expect(err.code).assertEqual(8300001);
done(); done();
}); });
}); });
/** /**
* @tc.number Telephony_Sim_isSimActive_Promise_0700 * @tc.number Telephony_Sim_isSimActive_Promise_0700
* @tc.name Test the slotId exception input parameter 2 during isSimActive interface card activation, * @tc.name Test the slotId exception input parameter 2 during isSimActive interface card activation,
* check the callback value, and expect the callback result flase * check the callback value, and expect the callback result flase
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_isSimActive_Promise_0700', 0, async function (done) { it('Telephony_Sim_isSimActive_Promise_0700', 0, async function (done) {
let promise = sim.isSimActive(env.SLOTID2); let promise = sim.isSimActive(env.SLOTID2);
promise.then(data => { promise.then(data => {
console.log(`isSimActive success, promise: data->${JSON.stringify(data)}`); console.log(`isSimActive success, promise: data->${JSON.stringify(data)}`);
expect(data).assertFalse(); expect(data).assertFalse();
done(); done();
}).catch(err => { }).catch(err => {
console.info("isSimActive promise err info :" + JSON.stringify(err)); console.info("isSimActive promise err info :" + JSON.stringify(err));
expect(err.code).assertEqual(8300001); expect(err.code).assertEqual(8300001);
done(); done();
});
}); });
});
/** /**
* @tc.number Telephony_Sim_hasSimCard_Async_0600 * @tc.number Telephony_Sim_hasSimCard_Async_0600
* @tc.name Test the slotId exception input parameter 2 of the hasSimCard interface, * @tc.name Test the slotId exception input parameter 2 of the hasSimCard interface,
* check the callback value, and expect the callback result flase * check the callback value, and expect the callback result flase
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_hasSimCard_Async_0600', 0, async function (done) { it('Telephony_Sim_hasSimCard_Async_0600', 0, async function (done) {
const CASE_NAME = 'Telephony_Sim_hasSimCard_Async_0600'; const CASE_NAME = 'Telephony_Sim_hasSimCard_Async_0600';
sim.hasSimCard(env.SLOTID2, (err, data) => { sim.hasSimCard(env.SLOTID2, (err, data) => {
if (err) { if (err) {
expect(err.code).assertEqual(8300001);
console.info(CASE_NAME +' fail, err: ' + JSON.stringify(err));
done();
return;
}
console.info(CASE_NAME + ' finish' + JSON.stringify(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 {
let data = await sim.hasSimCard(env.SLOTID2);
} catch (err) {
expect(err.code).assertEqual(8300001); expect(err.code).assertEqual(8300001);
console.info(CASE_NAME +' fail, err: ' + JSON.stringify(err)); console.info(CASE_NAME +' fail, err: ' + JSON.stringify(err));
done(); done();
return; return;
} }
console.info(CASE_NAME + ' finish' + JSON.stringify(data)); console.info(CASE_NAME + ' finish');
}); });
});
/** /**
* @tc.number Telephony_Sim_hasSimCard_Promise_0600 * @tc.number Telephony_Sim_getMaxSimCount_0100
* @tc.name Test the slotId exception input parameter 2 of the hasSimCard interface, * @tc.name Test the getMaxSimCount interface and view the callback result
* check the callback value, and expect the callback result flase * @tc.desc Function test
* @tc.desc Function test
*/ */
it('Telephony_Sim_hasSimCard_Promise_0600', 0, async function (done) { it('Telephony_Sim_getMaxSimCount_0100', 0, function (done) {
const CASE_NAME = 'Telephony_Sim_hasSimCard_Promise_0600'; const CASE_NAME = 'Telephony_Sim_getMaxSimCount_0100';
try { let simCount = sim.getMaxSimCount();
let data = await sim.hasSimCard(env.SLOTID2); expect(simCount > env.SIM_MIN_COUNT).assertTrue();
} catch (err) { console.info(`${CASE_NAME} test finish.`);
expect(err.code).assertEqual(8300001);
console.info(CASE_NAME +' fail, err: ' + JSON.stringify(err));
done(); done();
return; });
}
console.info(CASE_NAME + ' finish');
});
/** /**
* @tc.number Telephony_Sim_getMaxSimCount_0100 * @tc.number Telephony_Sim_GetCardType_Async_0400
* @tc.name Test the getMaxSimCount interface and view the callback result * @tc.name Verify that the slotId of the GetCardType async callback interface is abnormal
* @tc.desc Function test * and enter parameter 2, and check the callback value
*/ * @tc.desc Function test
it('Telephony_Sim_getMaxSimCount_0100', 0, function (done) { */
const CASE_NAME = 'Telephony_Sim_getMaxSimCount_0100'; it('Telephony_Sim_GetCardType_Async_0400', 0, function (done) {
let simCount = sim.getMaxSimCount(); const CASE_NAME = 'Telephony_Sim_GetCardType_Async_0400';
expect(simCount > env.SIM_MIN_COUNT).assertTrue(); sim.getCardType(env.SLOTID2, (err, cardType) => {
console.info(`${CASE_NAME} test finish.`); if (err) {
done(); console.info(CASE_NAME + ' GetCardType error: ' + JSON.stringify(err));
}); expect(err.code).assertEqual(8300001);
done();
return;
}
console.info(CASE_NAME + ' finish' + JSON.stringify(cardType));
expect().assertFail();
done();
});
});
/** /**
* @tc.number Telephony_Sim_GetCardType_Async_0400 * @tc.number Telephony_Sim_GetCardType_Promise_0400
* @tc.name Verify that the slotId of the GetCardType async callback interface is abnormal * @tc.name Verify that the slotId of the GetCardType promise interface is abnormal
* and enter parameter 2, and check the callback value * and enter parameter 2, and check the callback value
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_GetCardType_Async_0400', 0, function (done) { it('Telephony_Sim_GetCardType_Promise_0400', 0, async function (done) {
const CASE_NAME = 'Telephony_Sim_GetCardType_Async_0400'; const CASE_NAME = 'Telephony_Sim_GetCardType_Promise_0400';
sim.getCardType(env.SLOTID2, (err, cardType) => { try {
if (err) { const cardType = await sim.getCardType(env.SLOTID2);
console.info(CASE_NAME + ' finish');
} catch (err) {
console.info(CASE_NAME + ' GetCardType error: ' + JSON.stringify(err)); console.info(CASE_NAME + ' GetCardType error: ' + JSON.stringify(err));
expect(err.code).assertEqual(8300001); expect(err.code).assertEqual(8300001);
done();
return;
} }
console.info(CASE_NAME + ' finish' + JSON.stringify(cardType));
expect().assertFail();
done(); done();
}); });
});
/** /**
* @tc.number Telephony_Sim_GetCardType_Promise_0400 * @tc.number Telephony_Sim_hasOperatorPrivileges_Async_0400
* @tc.name Verify that the slotId of the GetCardType promise interface is abnormal * @tc.name Test hasOperatorPrivileges interface slotId exception enter parameter 2,
* and enter parameter 2, and check the callback value * check the callback result
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_GetCardType_Promise_0400', 0, async function (done) { it('Telephony_Sim_hasOperatorPrivileges_Async_0400', 0, function (done) {
const CASE_NAME = 'Telephony_Sim_GetCardType_Promise_0400'; const CASE_NAME = 'Telephony_Sim_hasOperatorPrivileges_Async_0400';
try { sim.hasOperatorPrivileges(env.SLOTID2, (error, result) => {
const cardType = await sim.getCardType(env.SLOTID2); if (error) {
console.info(CASE_NAME + ' finish'); console.info(CASE_NAME + 'hasOperatorPrivileges error: ' + JSON.stringify(error));
} catch (err) { expect(error.code).assertEqual(8300001);
console.info(CASE_NAME + ' GetCardType error: ' + JSON.stringify(err)); done();
expect(err.code).assertEqual(8300001); return;
} }
done(); console.info(CASE_NAME + ' finish' + JSON.stringify(result));
}); expect().assertFail();
done();
});
});
/** /**
* @tc.number Telephony_Sim_hasOperatorPrivileges_Async_0400 * @tc.number Telephony_Sim_hasOperatorPrivileges_Promise_0400
* @tc.name Test hasOperatorPrivileges interface slotId exception enter parameter 2, * @tc.name Test hasOperatorPrivileges interface slotId exception enter parameter 2,
* check the callback result * check the returned result
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_hasOperatorPrivileges_Async_0400', 0, function (done) { it('Telephony_Sim_hasOperatorPrivileges_Promise_0400', 0, async function (done) {
const CASE_NAME = 'Telephony_Sim_hasOperatorPrivileges_Async_0400'; const CASE_NAME = 'Telephony_Sim_hasOperatorPrivileges_Promise_0400';
sim.hasOperatorPrivileges(env.SLOTID2, (error, result) => { try {
if (error) { const result = await sim.hasOperatorPrivileges(env.SLOTID2);
console.info(CASE_NAME + ' finish' + JSON.stringify(result));
expect().assertFail();
done();
} catch (error) {
console.info(CASE_NAME + 'hasOperatorPrivileges error: ' + JSON.stringify(error)); console.info(CASE_NAME + 'hasOperatorPrivileges error: ' + JSON.stringify(error));
expect(error.code).assertEqual(8300001); expect(error.code).assertEqual(8300001);
done();
return;
} }
console.info(CASE_NAME + ' finish' + JSON.stringify(result));
expect().assertFail();
done(); done();
}); });
});
/**
* @tc.number Telephony_Sim_hasOperatorPrivileges_Promise_0400
* @tc.name Test hasOperatorPrivileges interface slotId exception enter parameter 2,
* check the returned result
* @tc.desc Function test
*/
it('Telephony_Sim_hasOperatorPrivileges_Promise_0400', 0, async function (done) {
const CASE_NAME = 'Telephony_Sim_hasOperatorPrivileges_Promise_0400';
try {
const result = await sim.hasOperatorPrivileges(env.SLOTID2);
console.info(CASE_NAME + ' finish' + JSON.stringify(result));
expect().assertFail();
done();
} catch (error) {
console.info(CASE_NAME + 'hasOperatorPrivileges error: ' + JSON.stringify(error));
expect(error.code).assertEqual(8300001);
}
done();
});
/** /**
* @tc.number Telephony_Sim_getOpKey_CallBack_0100 * @tc.number Telephony_Sim_getOpKey_CallBack_0100
* @tc.name Test getOpKey interface * @tc.name Test getOpKey interface
* @tc.desc Obtains the opkey of the SIM card in a specified slot.Returns the opkey; * @tc.desc Obtains the opkey of the SIM card in a specified slot.Returns the opkey;
* returns "-1" if no SIM card is inserted or no opkey matched. * returns "-1" if no SIM card is inserted or no opkey matched.
*/ */
it('Telephony_Sim_getOpKey_CallBack_0100', 0, async function (done) { it('Telephony_Sim_getOpKey_CallBack_0100', 0, async function (done) {
sim.getOpKey(0, (err, data) => { sim.getOpKey(0, (err, data) => {
console.info("Telephony_Sim_getOpKey_CallBack_0100 err = " + JSON.stringify(err) + " data = " + JSON.stringify(data)); console.info("Telephony_Sim_getOpKey_CallBack_0100 err = " + JSON.stringify(err) + " data = " + JSON.stringify(data));
if(err){ if(err){
expect(err.code).assertEqual(-1); expect(err.code).assertEqual(-1);
done();
return;
}
done(); done();
return;
}
done();
}); });
}); });
/** /**
* @tc.number Telephony_Sim_getOpKey_Promise_0100 * @tc.number Telephony_Sim_getOpKey_Promise_0100
* @tc.name Test getOpKey interface * @tc.name Test getOpKey interface
* @tc.desc Obtains the opkey of the SIM card in a specified slot.Returns the opkey; * @tc.desc Obtains the opkey of the SIM card in a specified slot.Returns the opkey;
* returns "-1" if no SIM card is inserted or no opkey matched. * returns "-1" if no SIM card is inserted or no opkey matched.
*/ */
it('Telephony_Sim_getOpKey_Promise_0100', 0, async function (done) { it('Telephony_Sim_getOpKey_Promise_0100', 0, async function (done) {
let promise = sim.getOpKey(0); let promise = sim.getOpKey(0);
promise.then(data => { promise.then(data => {
console.info("Telephony_Sim_getOpKey_Promise_0100 data = " + JSON.stringify(data)); console.info("Telephony_Sim_getOpKey_Promise_0100 data = " + JSON.stringify(data));
done(); done();
}).catch(err => { }).catch(err => {
console.info("Telephony_Sim_getOpKey_Promise_0100 err = " + JSON.stringify(err)); console.info("Telephony_Sim_getOpKey_Promise_0100 err = " + JSON.stringify(err));
expect(err.code).assertEqual(-1); expect(err.code).assertEqual(-1);
done(); done();
}); });
}); });
/** /**
* @tc.number Telephony_Sim_getOpName_CallBack_0100 * @tc.number Telephony_Sim_getOpName_CallBack_0100
* @tc.name Test getOpName interface * @tc.name Test getOpName interface
* @tc.desc Obtains the opname of the SIM card in a specified slot. * @tc.desc Obtains the opname of the SIM card in a specified slot.
* returns null if no SIM card is inserted or no opname matched. * returns null if no SIM card is inserted or no opname matched.
*/ */
it('Telephony_Sim_getOpName_CallBack_0100', 0, async function (done) { it('Telephony_Sim_getOpName_CallBack_0100', 0, async function (done) {
sim.getOpName(0, (err, data) => { sim.getOpName(0, (err, data) => {
console.info("Telephony_Sim_getOpName_CallBack_0100 err = " + JSON.stringify(err) + " data = " + JSON.stringify(data)); console.info("Telephony_Sim_getOpName_CallBack_0100 err = " + JSON.stringify(err) + " data = " + JSON.stringify(data));
if(err){ if(err){
expect(err.code).assertEqual(-1); expect(err.code).assertEqual(-1);
done();
return;
}
done(); done();
return;
}
done();
}); });
}); });
/** /**
* @tc.number Telephony_Sim_getOpName_Promise_0100 * @tc.number Telephony_Sim_getOpName_Promise_0100
* @tc.name Test getOpName interface * @tc.name Test getOpName interface
* @tc.desc Obtains the opname of the SIM card in a specified slot. * @tc.desc Obtains the opname of the SIM card in a specified slot.
* returns null if no SIM card is inserted or no opname matched. * returns null if no SIM card is inserted or no opname matched.
*/ */
it('Telephony_Sim_getOpName_Promise_0100', 0, async function (done) { it('Telephony_Sim_getOpName_Promise_0100', 0, async function (done) {
let promise = sim.getOpName(0); let promise = sim.getOpName(0);
promise.then(data => { promise.then(data => {
console.info("Telephony_Sim_getOpName_Promise_0100 data = " + JSON.stringify(data)); console.info("Telephony_Sim_getOpName_Promise_0100 data = " + JSON.stringify(data));
done(); done();
}).catch(err => { }).catch(err => {
console.info("Telephony_Sim_getOpName_Promise_0100 err = " + JSON.stringify(err)); console.info("Telephony_Sim_getOpName_Promise_0100 err = " + JSON.stringify(err));
expect(err.code).assertEqual(-1); expect(err.code).assertEqual(-1);
done(); done();
}); });
}); });
/** /**
* @tc.number Telephony_Sim_getSimAccountInfo_CallBack_0100 * @tc.number Telephony_Sim_getSimAccountInfo_CallBack_0100
* @tc.name Test getOpName interface * @tc.name Test getOpName interface
* @tc.desc * @tc.desc
*/ */
it('Telephony_Sim_getSimAccountInfo_CallBack_0100', 0, async function (done) { it('Telephony_Sim_getSimAccountInfo_CallBack_0100', 0, async function (done) {
sim.getSimAccountInfo(0, (err, data) => { sim.getSimAccountInfo(0, (err, data) => {
if(err){ if(err){
console.info("Telephony_Sim_getSimAccountInfo_CallBack_0100 err = " + JSON.stringify(err)); console.info("Telephony_Sim_getSimAccountInfo_CallBack_0100 err = " + JSON.stringify(err));
radio.isRadioOn(0, (err, data) => { expect(true).assertTrue();
console.info('Telephony_Sim_getSimAccountInfo_CallBack_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data)); done();
if (!err) { return;
expect().assertFail(); }
} console.log(`Telephony_Sim_getSimAccountInfo_CallBack_0100 callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sim.hasSimCard(0, (err, data) => {
console.log(`Telephony_Sim_getSimAccountInfo_CallBack_0100 hasSimCard callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
expect(data).assertTrue();
done();
}); });
done(); });
return;
}
console.log(`Telephony_Sim_getSimAccountInfo_CallBack_0100 callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
expect(true).assertTrue();
done();
}); });
}); /**
/** * @tc.number Telephony_Sim_getSimAccountInfo_Promise_0100
* @tc.number Telephony_Sim_getSimAccountInfo_Promise_0100 * @tc.name Test getOpName interface
* @tc.name Test getOpName interface * @tc.desc
* @tc.desc */
*/ it('Telephony_Sim_getSimAccountInfo_Promise_0100', 0, async function (done) {
it('Telephony_Sim_getSimAccountInfo_Promise_0100', 0, async function (done) { let promise = sim.getSimAccountInfo(0);
let promise = sim.getSimAccountInfo(0); promise.then(data => {
promise.then(data => {
console.info("Telephony_Sim_getSimAccountInfo_Promise_0100 data = " + JSON.stringify(data)); console.info("Telephony_Sim_getSimAccountInfo_Promise_0100 data = " + JSON.stringify(data));
expect(true).assertTrue(); sim.hasSimCard(0, (err, data) => {
done(); console.log(`Telephony_Sim_getSimAccountInfo_Promise_0100 hasSimCard callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
}).catch(err => { expect(data).assertTrue();
console.info("Telephony_Sim_getSimAccountInfo_Promise_0100 err = " + JSON.stringify(err)); done();
radio.isRadioOn(0, (err, data) => {
console.info('Telephony_Sim_getSimAccountInfo_Promise_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data));
if (!err) {
expect().assertFail();
}
}); });
}).catch(err => {
console.info("Telephony_Sim_getSimAccountInfo_Promise_0100 err = " + JSON.stringify(err));
expect(true).assertTrue();
done(); done();
});
}); });
}); /**
/** * @tc.number Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100
* @tc.number Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100 * @tc.name Test getOpName interface
* @tc.name Test getOpName interface * @tc.desc
* @tc.desc */
*/ it('Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100', 0, async function (done) {
it('Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100', 0, async function (done) { sim.getActiveSimAccountInfoList((err, data) => {
sim.getActiveSimAccountInfoList((err, data) => { if(err){
if(err){ console.info("Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100 err = " + JSON.stringify(err));
console.info("Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100 err = " + JSON.stringify(err)); expect(true).assertTrue();
radio.isRadioOn(0, (err, data) => { done();
console.info('Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data)); return;
if (!err) { }
expect().assertFail(); console.log(`Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100 callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
} sim.hasSimCard(0, (err, data) => {
console.log(`Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100 hasSimCard callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
expect(data).assertTrue();
done();
}); });
done(); });
return;
}
console.log(`Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100 callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
expect(true).assertTrue();
done();
}); });
}); /**
/** * @tc.number Telephony_Sim_getActiveSimAccountInfoList_Promise_0100
* @tc.number Telephony_Sim_getActiveSimAccountInfoList_Promise_0100 * @tc.name Test getOpName interface
* @tc.name Test getOpName interface * @tc.desc
* @tc.desc */
*/ it('Telephony_Sim_getActiveSimAccountInfoList_Promise_0100', 0, async function (done) {
it('Telephony_Sim_getActiveSimAccountInfoList_Promise_0100', 0, async function (done) { let promise = sim.getActiveSimAccountInfoList();
let promise = sim.getActiveSimAccountInfoList(); promise.then(data => {
promise.then(data => {
console.info("Telephony_Sim_getActiveSimAccountInfoList_Promise_0100 data = " + JSON.stringify(data)); console.info("Telephony_Sim_getActiveSimAccountInfoList_Promise_0100 data = " + JSON.stringify(data));
expect(true).assertTrue(); sim.hasSimCard(0, (err, data) => {
done(); console.log(`Telephony_Sim_getActiveSimAccountInfoList_Promise_0100 hasSimCard callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
}).catch(err => { expect(data).assertTrue();
console.info("Telephony_Sim_getActiveSimAccountInfoList_Promise_0100 err = " + JSON.stringify(err)); done();
radio.isRadioOn(0, (err, data) => {
console.info('Telephony_Sim_getActiveSimAccountInfoList_Promise_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data));
if (!err) {
expect().assertFail();
}
}); });
}).catch(err => {
console.info("Telephony_Sim_getActiveSimAccountInfoList_Promise_0100 err = " + JSON.stringify(err));
expect(true).assertTrue();
done(); done();
});
}); });
});
/** /**
* @tc.number Telephony_Sim_getDefaultVoiceSimId_CallBack_0100 * @tc.number Telephony_Sim_getDefaultVoiceSimId_CallBack_0100
* @tc.name Test getOpName interface * @tc.name Test getOpName interface
* @tc.desc * @tc.desc
*/ */
it('Telephony_Sim_getDefaultVoiceSimId_CallBack_0100', 0, async function (done) { it('Telephony_Sim_getDefaultVoiceSimId_CallBack_0100', 0, async function (done) {
sim.getDefaultVoiceSimId((err, data) => { sim.getDefaultVoiceSimId((err, data) => {
if(err){ if(err){
console.info("Telephony_Sim_getDefaultVoiceSimId_CallBack_0100 err = " + JSON.stringify(err)); console.info("Telephony_Sim_getDefaultVoiceSimId_CallBack_0100 err = " + JSON.stringify(err));
radio.isRadioOn(0, (err, data) => { expect(true).assertTrue();
console.info('Telephony_Sim_getDefaultVoiceSimId_CallBack_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data)); done();
if (!err) { return;
expect().assertFail(); }
} console.log(`Telephony_Sim_getDefaultVoiceSimId_CallBack_0100 callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sim.hasSimCard(0, (err, data) => {
console.log(`Telephony_Sim_getDefaultVoiceSimId_CallBack_0100 hasSimCard callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
expect(data).assertTrue();
done();
}); });
done(); });
return;
}
console.log(`Telephony_Sim_getDefaultVoiceSimId_CallBack_0100 callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
expect(true).assertTrue();
done();
}); });
}); /**
/** * @tc.number Telephony_Sim_getDefaultVoiceSimId_Promise_0100
* @tc.number Telephony_Sim_getDefaultVoiceSimId_Promise_0100 * @tc.name Test getOpName interface
* @tc.name Test getOpName interface * @tc.desc
* @tc.desc */
*/ it('Telephony_Sim_getDefaultVoiceSimId_Promise_0100', 0, async function (done) {
it('Telephony_Sim_getDefaultVoiceSimId_Promise_0100', 0, async function (done) { let promise = sim.getDefaultVoiceSimId();
let promise = sim.getDefaultVoiceSimId(); promise.then(data => {
promise.then(data => {
console.info("Telephony_Sim_getDefaultVoiceSimId_Promise_0100 data = " + JSON.stringify(data)); console.info("Telephony_Sim_getDefaultVoiceSimId_Promise_0100 data = " + JSON.stringify(data));
expect(true).assertTrue(); sim.hasSimCard(0, (err, data) => {
done(); console.log(`Telephony_Sim_getDefaultVoiceSimId_Promise_0100 hasSimCard callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
}).catch(err => { expect(data).assertTrue();
console.info("Telephony_Sim_getDefaultVoiceSimId_Promise_0100 err = " + JSON.stringify(err)); done();
radio.isRadioOn(0, (err, data) => {
console.info('Telephony_Sim_getDefaultVoiceSimId_Promise_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data));
if (!err) {
expect().assertFail();
}
}); });
}).catch(err => {
console.info("Telephony_Sim_getDefaultVoiceSimId_Promise_0100 err = " + JSON.stringify(err));
expect(true).assertTrue();
done(); done();
});
}); });
}); })
}
\ No newline at end of file
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册