提交 cca3e4b1 编写于 作者: S shuxiong

电话子系统JS代码更新

Signed-off-by: Nshuxiong <shuxiong@huawei.com>
上级 c11f77bf
......@@ -21,4 +21,4 @@ group("telephonyjstest") {
"sim:sim",
"sms_mms:sms_mms",
]
}
}
\ No newline at end of file
......@@ -22,4 +22,4 @@ group("call_manager") {
"call_manager_test:CallManagerTest",
]
}
}
}
\ No newline at end of file
......@@ -28,4 +28,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
}
\ No newline at end of file
......@@ -27,6 +27,7 @@ describe('CallManagerMMI', function () {
it('Telephony_CallManager_MMI_Async_0100', 0, async function (done) {
call.dial('**21*12599*10#', (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_MMI_Async_0100 fail');
done();
return;
......@@ -34,16 +35,17 @@ describe('CallManagerMMI', function () {
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0100 finish data = ' + data);
done();
})
call.dial('##002#', (err, data) => {
if (err) {
console.log('Telephony_CallManager_MMI_Async_0100 fail');
call.dial('##002#', (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_MMI_Async_0100 fail');
done();
return;
}
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0100 finish data = ' + data);
done();
return;
}
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0100 finish data = ' + data);
done();
})
})
})
......@@ -56,22 +58,24 @@ describe('CallManagerMMI', function () {
it('Telephony_CallManager_MMI_Async_0200', 0, async function (done) {
call.dial('**33*0000#', (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_MMI_Async_0200 fail');
done();
return;
}
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0200 finish data = ' + data);
})
call.dial('#33*0000#', (err, data) => {
if (err) {
console.log('Telephony_CallManager_MMI_Async_0200 fail');
call.dial('#33*0000#', (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_MMI_Async_0200 fail');
done();
return;
}
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0200 finish data = ' + data);
done();
return;
}
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0200 finish data = ' + data);
done();
})
})
})
......@@ -84,22 +88,24 @@ describe('CallManagerMMI', function () {
it('Telephony_CallManager_MMI_Async_0300', 0, async function (done) {
call.dial('*331*0000#', (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_MMI_Async_0300 fail');
done();
return;
}
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0300 finish data = ' + data);
})
call.dial('#331#0000#', (err, data) => {
if (err) {
console.log('Telephony_CallManager_MMI_Async_0300 fail');
call.dial('#331#0000#', (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_MMI_Async_0300 fail');
done();
return;
}
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0300 finish data = ' + data);
done();
return;
}
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0300 finish data = ' + data);
done();
})
})
})
......@@ -112,6 +118,7 @@ describe('CallManagerMMI', function () {
it('Telephony_CallManager_MMI_Async_0400', 0, async function (done) {
call.dial('#35*0000#', (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_MMI_Async_0400 fail');
done();
return;
......@@ -132,12 +139,12 @@ describe('CallManagerMMI', function () {
var data = await call.dial('##330*0000#');
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Promise_0100 finish data = ' + data);
done();
} catch (err) {
console.log('Telephony_CallManager_MMI_Promise_0100 fail');
expect().assertFail();
done();
}
done();
})
/*
......@@ -151,12 +158,12 @@ describe('CallManagerMMI', function () {
var data = await call.dial('*#330#0000#');
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Promise_0200 finish data = ' + data);
done();
} catch (err) {
expect().assertFail();
console.log('Telephony_CallManager_MMI_Promise_0200 fail');
done();
}
done();
})
/*
......@@ -169,12 +176,12 @@ describe('CallManagerMMI', function () {
var data = await call.dial('*#31#');
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Promise_0300 finish data = ' + data);
done();
} catch (err) {
expect().assertFail();
console.log('Telephony_CallManager_MMI_Promise_0300 fail');
done();
}
done();
})
/*
......@@ -191,16 +198,17 @@ describe('CallManagerMMI', function () {
expect().assertFail();
console.log('Telephony_CallManager_MMI_Promise_0400 fail');
done();
return;
}
try {
var data = await call.dial('*31#');
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Promise_0400 finish data = ' + data);
done();
} catch (err) {
expect().assertFail();
console.log('Telephony_CallManager_MMI_Promise_0400 fail');
done();
}
done();
})
})
......@@ -28,4 +28,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
}
\ No newline at end of file
......@@ -28,4 +28,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
}
\ No newline at end of file
......@@ -16,7 +16,21 @@
# 配置发送短信的电话号码
config_const_var[0]="const SMS_SEND_DST_NUMBER = '138xxxxxxxx';"
#配置通话管理自动接听号码
config_const_var[1]="const CALLMANAGER_TEST_PHONY_NUMBER = '10086';"
# 短信测试中使用到的短信中心服务地址
config_const_var[2]="const OTHER_SMSC_NUMBER = '+86138xxxxxxxx';"
config_const_var[3]="const USABLE_SMSC_NUMBER = '+86138xxxxxxxx';"
#通话管理用例使用号码
config_const_var[4]="const INVALID_NUMBER = '138xxxxxxxx';"
config_const_var[5]="const THE_THREE_NUMBER = '112';"
config_const_var[6]="const EIGHTEEN_DIGITS = '123456789123456789';"
config_const_var[7]="const WITH_LETTER_NUMBER = 'abcde123456';"
config_const_var[8]="const EIGHT_NUMBER = '00000000';"
config_const_var[9]="const EIGHT_NUMBER_WITH_AN_AREA_CODE = '0898 0000 0000';"
config_const_var[10]="const MORE_THAN_30_NUMBERS = '12345678901234567890012345678901';"
for((i = 0; i < ${#config_const_var}; i++))
do
......@@ -27,7 +41,7 @@ do
key=`echo ${config_const_var[i]}| awk -F= '{print $1}'`
for line in `grep -nr "${key}"| sed 's/ //g'|grep -v "config.sh"`
do
file=`echo ${line}|awk -F: '{print $1}'`
line_no=`echo ${line}|awk -F: '{print $2}'`
echo $file $line_no
......
......@@ -23,4 +23,4 @@ group("network_search") {
"network_search_selection_mode:NetworkSearchSelectionMoce",
]
}
}
}
\ No newline at end of file
......@@ -27,4 +27,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
}
\ No newline at end of file
......@@ -65,7 +65,6 @@ describe('NetworkSearchTest', function () {
const ISO_COUNTRY_CODE = 'cn';
const PLMN_SIZE = 5;
/**
* @tc.number Telephony_NetworkSearch_getNetworkState_Async_0100
* @tc.name Test the getNetworkState() query function and return the default card 0 network registration status
......@@ -97,8 +96,8 @@ describe('NetworkSearchTest', function () {
data.plmnNumeric != null
).assertTrue();
expect(data.plmnNumeric.length == 5 && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
expect(garrRegState).assertContain(data.regStatus);
expect(data.nsaState === 1).assertTrue();
expect(data.regStatus === radio.REG_STATE_IN_SERVICE).assertTrue();
expect(data.nsaState === radio.NSA_STATE_NOT_SUPPORT).assertTrue();
expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue();
expect(data.isEmergency === false).assertTrue();
......@@ -129,8 +128,8 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null
).assertTrue();
expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
expect(garrRegState).assertContain(data.regStatus);
expect(data.nsaState === 1).assertTrue();
expect(data.regStatus === radio.REG_STATE_IN_SERVICE).assertTrue();
expect(data.nsaState === radio.NSA_STATE_NOT_SUPPORT).assertTrue();
expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue();
expect(data.isEmergency === false).assertTrue();
......@@ -174,8 +173,7 @@ describe('NetworkSearchTest', function () {
done();
return;
}
console.log(`Telephony_NetworkSearch_getRadioTech_Async_0100 finish psRadioTech: ${psRadioTech}
csRadioTech: ${csRadioTech}`);
console.log(`Telephony_NetworkSearch_getRadioTech_Async_0100 finish ps: ${psRadioTech} cs: ${csRadioTech}`);
expect(garrRadioTech).assertContain(psRadioTech);
expect(garrRadioTech).assertContain(csRadioTech);
done();
......@@ -249,7 +247,7 @@ describe('NetworkSearchTest', function () {
return;
}
console.log(`Telephony_NetworkSearch_getSignalInformation_Async_0400 finish data: ${JSON.stringify(data)}`);
expect(data === undefined || data.length === 0).assertTrue();
expect(data.length === 0).assertTrue();
done();
});
});
......@@ -271,8 +269,8 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null
).assertTrue();
expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
expect(garrRegState).assertContain(data.regStatus);
expect(data.nsaState === 1).assertTrue();
expect(data.regStatus === radio.REG_STATE_IN_SERVICE).assertTrue();
expect(data.nsaState === radio.NSA_STATE_NOT_SUPPORT).assertTrue();
expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue();
expect(data.isEmergency === false).assertTrue();
......@@ -304,8 +302,8 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null
).assertTrue();
expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
expect(garrRegState).assertContain(data.regStatus);
expect(data.nsaState === 1).assertTrue();
expect(data.regStatus === radio.REG_STATE_IN_SERVICE).assertTrue();
expect(data.nsaState === radio.NSA_STATE_NOT_SUPPORT).assertTrue();
expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue();
expect(data.isEmergency === false).assertTrue();
......@@ -419,7 +417,7 @@ describe('NetworkSearchTest', function () {
let data = await radio.getSignalInformation(slotId);
console.log(
`Telephony_NetworkSearch_getSignalInformation_Promise_0400 finish data: ${JSON.stringify(data)}`);
expect(data === undefined || data.length === 0).assertTrue();
expect(data.length === 0).assertTrue();
} catch (err) {
console.log(`Telephony_NetworkSearch_getSignalInformation_Promise_0400 fail err: ${err}`);
expect().assertFail();
......@@ -485,7 +483,7 @@ describe('NetworkSearchTest', function () {
}
console.log(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400 finish data: ${JSON.stringify(data)}`);
expect(data === undefined || data.length === 0).assertTrue();
expect(data.length === 0).assertTrue();
done();
});
});
......@@ -501,7 +499,7 @@ describe('NetworkSearchTest', function () {
let data = await radio.getISOCountryCodeForNetwork(slotId);
console.log(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 finish data:${JSON.stringify(data)}`);
expect(data === undefined || data.length === 0).assertTrue();
expect(data.length === 0).assertTrue();
} catch (err) {
console.log(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 fail err: ${err}`);
expect().assertFail();
......
......@@ -27,4 +27,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
}
\ No newline at end of file
......@@ -27,4 +27,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
}
\ No newline at end of file
......@@ -25,4 +25,4 @@ group("sim") {
"sim_state_manager_function_test:SimStateManagerFunctionTest",
]
}
}
}
\ No newline at end of file
......@@ -28,4 +28,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
}
\ No newline at end of file
......@@ -49,6 +49,7 @@ describe('SimFileManagerFunction', function () {
sim.getIMSI(simSlotId.SLOT_ID_4, (err, data) => {
if (err) {
// Enter the exception ID to enter err.
console.log(`Telephony_Sim_getIMSI_Async_0200, err: ${err.message}`);
console.log('Telephony_Sim_getIMSI_Async_0200 finish');
done();
return;
......@@ -66,7 +67,7 @@ describe('SimFileManagerFunction', function () {
*/
it('Telephony_Sim_getIMSI_Promise_0100', 0, async function (done) {
try {
var data = await sim.getIMSI(simSlotId.SLOT_ID_0);
let data = await sim.getIMSI(simSlotId.SLOT_ID_0);
console.log(`Telephony_Sim_getIMSI_Promise_0100 data = ${data}`);
expect(data !== '' || data !== undefined).assertTrue();
expect(data.length === IMSI_LENGTH).assertTrue();
......@@ -86,8 +87,10 @@ describe('SimFileManagerFunction', function () {
*/
it('Telephony_Sim_getIMSI_Promise_0200', 0, async function (done) {
try {
var data = await sim.getIMSI(simSlotId.SLOT_ID_4);
let data = await sim.getIMSI(simSlotId.SLOT_ID_4);
} catch (err) {
// Enter the exception ID to enter err.
console.log(`Telephony_Sim_getIMSI_Promise_0200, err: ${err.message}`);
console.log('Telephony_Sim_getIMSI_Promise_0200 finish');
done();
return;
......@@ -127,6 +130,7 @@ describe('SimFileManagerFunction', function () {
sim.getSimIccId(simSlotId.SLOT_ID_4, (err, data) => {
if (err) {
// Enter the exception ID to enter err.
console.log(`Telephony_Sim_getSimIccId_Async_0200, err: ${err.message}`);
console.log('Telephony_Sim_getSimIccId_Async_0200 finish');
done();
return;
......@@ -144,7 +148,7 @@ describe('SimFileManagerFunction', function () {
*/
it('Telephony_Sim_getSimIccId_Promise_0100', 0, async function (done) {
try {
var data = await sim.getSimIccId(simSlotId.SLOT_ID_0);
let data = await sim.getSimIccId(simSlotId.SLOT_ID_0);
console.log(`Telephony_Sim_getSimIccId_Promise_0100 data${data}`);
expect(data !== '' || data !== undefined).assertTrue();
expect(data.length === ICC_LENGTH).assertTrue();
......@@ -164,8 +168,9 @@ describe('SimFileManagerFunction', function () {
*/
it('Telephony_Sim_getSimIccId_Promise_0200', 0, async function (done) {
try {
var data = await sim.getSimIccId(simSlotId.SLOT_ID_4);
let data = await sim.getSimIccId(simSlotId.SLOT_ID_4);
} catch (err) {
console.log(`Telephony_Sim_getSimIccId_Promise_0200, err: ${err.message}`);
console.log('Telephony_Sim_getSimIccId_Promise_0200 finish');
done();
return;
......@@ -182,7 +187,7 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test
*/
it('Telephony_Sim_getISOCountryCodeForSim_Async_0100', 0, async function (done) {
var countryCode = 'cn';
let countryCode = 'cn';
sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_0, (err, data) => {
if (err) {
console.log(`Telephony_Sim_getISOCountryCodeForSim_Async_0100 fail, err: ${err.message}`);
......@@ -208,6 +213,7 @@ describe('SimFileManagerFunction', function () {
sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_4, (err, data) => {
if (err) {
// Expect slot id 4 return err here.
console.log(`Telephony_Sim_getISOCountryCodeForSim_Async_0200, err: ${err.message}`);
console.log('Telephony_Sim_getISOCountryCodeForSim_Async_0200 finish');
done();
return;
......@@ -225,9 +231,9 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test
*/
it('Telephony_Sim_getISOCountryCodeForSim_Promise_0100', 0, async function (done) {
var countryCode = 'cn';
let countryCode = 'cn';
try {
var data = await sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_0);
let data = await sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_0);
console.log(`Telephony_Sim_getISOCountryCodeForSim_Promise_0100, data = ${data}`);
// The country code for mainland China is cn.
expect(data === countryCode).assertTrue();
......@@ -252,6 +258,7 @@ describe('SimFileManagerFunction', function () {
var data = await sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_4);
} catch (err) {
// Expect slotid 4 return err here.
console.log(`Telephony_Sim_getISOCountryCodeForSim_Promise_0200, err: ${err.message}`);
console.log('Telephony_Sim_getISOCountryCodeForSim_Promise_0200 finish');
done();
return;
......@@ -268,7 +275,7 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test
*/
it('Telephony_Sim_getSimOperatorNumeric_Async_0100', 0, async function (done) {
var operatorNumTopThree = '460';
let operatorNumTopThree = '460';
sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0, (err, data) => {
if (err) {
console.log(`Telephony_Sim_getSimOperatorNumeric_Async_0100 fail, err: ${err.message}`);
......@@ -297,6 +304,7 @@ describe('SimFileManagerFunction', function () {
sim.getSimOperatorNumeric(simSlotId.SLOT_ID_4, (err, data) => {
if (err) {
// Expect slotid 4 return err here.
console.log(`Telephony_Sim_getSimOperatorNumeric_Async_0200, err: ${err.message}`);
console.log('Telephony_Sim_getSimOperatorNumeric_Async_0200 finish');
done();
return;
......@@ -314,9 +322,9 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test
*/
it('Telephony_Sim_getSimOperatorNumeric_Promise_0100', 0, async function (done) {
var operatorNumTopThree = '460';
let operatorNumTopThree = '460';
try {
var data = await sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0);
let data = await sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0);
console.log(`Telephony_Sim_getSimOperatorNumeric_Promise_0100, data = ${data}`);
expect(data !== '' && data !== undefined).assertTrue();
// The length of operator numeric in mainland China is 5.
......@@ -344,6 +352,7 @@ describe('SimFileManagerFunction', function () {
var data = await sim.getSimOperatorNumeric(simSlotId.SLOT_ID_4);
} catch (err) {
// Expect slotid 4 return err here.
console.log(`Telephony_Sim_getSimOperatorNumeric_Promise_0200, err: ${err.message}`);
console.log('Telephony_Sim_getSimOperatorNumeric_Promise_0200 finish');
done();
return;
......@@ -359,9 +368,9 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test
*/
it('Telephony_Sim_getSimSpn_Async_0100', 0, async function (done) {
var mobileSpn = '00434D4343FFFFFFFFFFFFFFFFFFFFFFFF';
var unicomSpn = '00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF';
var telecomSpn = '01804E2D56FD75354FE1FFFFFFFFFFFFFF';
let mobileSpn = '00434D4343FFFFFFFFFFFFFFFFFFFFFFFF';
let unicomSpn = '00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF';
let telecomSpn = '01804E2D56FD75354FE1FFFFFFFFFFFFFF';
sim.getSimSpn(simSlotId.SLOT_ID_0, (err, data) => {
if (err) {
console.log(`Telephony_Sim_getSimSpn_Async_0100 fail, err: ${err.message}`);
......@@ -404,6 +413,7 @@ describe('SimFileManagerFunction', function () {
sim.getSimSpn(simSlotId.SLOT_ID_4, (err, data) => {
if (err) {
// Expect slotid 4 return err here.
console.log(`Telephony_Sim_getSimSpn_Async_0200 fail: ${err.message}`);
console.log('Telephony_Sim_getSimSpn_Async_0200 finish');
done();
return;
......@@ -420,15 +430,15 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test
*/
it('Telephony_Sim_getSimSpn_Promise_0100', 0, async function (done) {
var mobileSpn = '00434D4343FFFFFFFFFFFFFFFFFFFFFFFF';
var unicomSpn = '00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF';
var telecomSpn = '01804E2D56FD75354FE1FFFFFFFFFFFFFF';
let mobileSpn = '00434D4343FFFFFFFFFFFFFFFFFFFFFFFF';
let unicomSpn = '00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF';
let telecomSpn = '01804E2D56FD75354FE1FFFFFFFFFFFFFF';
try {
var data = await sim.getSimSpn(simSlotId.SLOT_ID_0);
let data = await sim.getSimSpn(simSlotId.SLOT_ID_0);
console.log(`Telephony_Sim_getSimSpn_Promise_0100, data = ${data}`);
expect(data !== '' && data !== undefined).assertTrue();
try {
var value = await sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0);
let value = await sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0);
console.log(`Telephony_Sim_getSimSpn_Promise_0100, value : ${value}`);
if ((value === operatorCode.MOBILE_CODE_1) || (value === operatorCode.MOBILE_CODE_2) ||
(value === operatorCode.MOBILE_CODE_3) || (value === operatorCode.MOBILE_CODE_4)) {
......@@ -466,6 +476,7 @@ describe('SimFileManagerFunction', function () {
var data = await sim.getSimSpn(simSlotId.SLOT_ID_4);
} catch (err) {
// Expect slotid 4 return err here.
console.log(`Telephony_Sim_getSimSpn_Promise_0200, err: ${err.message}`);
console.log('Telephony_Sim_getSimSpn_Promise_0200 finish');
done();
return;
......@@ -481,7 +492,7 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test
*/
it('Telephony_Sim_getSimGid1_Async_0100', 0, async function (done) {
var minLength = 1;
let minLength = 1;
sim.getSimGid1(simSlotId.SLOT_ID_0, (err, data) => {
if (err) {
console.log(`Telephony_Sim_getSimGid1_Async_0100 fail, err: ${err.message}`);
......@@ -506,6 +517,7 @@ describe('SimFileManagerFunction', function () {
sim.getSimGid1(simSlotId.SLOT_ID_4, (err, data) => {
if (err) {
// Expect slotid 4 return err here.
console.log(`Telephony_Sim_getSimGid1_Async_0200, err: ${err.message}`);
console.log('Telephony_Sim_getSimGid1_Async_0200 finish');
done();
return;
......@@ -522,9 +534,9 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test
*/
it('Telephony_Sim_getSimGid1_Promise_0100', 0, async function (done) {
var minLength = 1;
let minLength = 1;
try {
var data = await sim.getSimGid1(simSlotId.SLOT_ID_0);
let data = await sim.getSimGid1(simSlotId.SLOT_ID_0);
console.log(`Telephony_Sim_getSimGid1_Promise_0100, data = ${data}`);
expect(data !== '' && data !== undefined).assertTrue();
expect((data.length >= minLength)).assertTrue();
......@@ -548,6 +560,7 @@ describe('SimFileManagerFunction', function () {
var data = await sim.getSimGid1(simSlotId.SLOT_ID_4);
} catch (err) {
// Expect slotid 4 return err here.
console.log(`Telephony_Sim_getSimGid1_Promise_0200, err: ${err.message}`);
console.log('Telephony_Sim_getSimGid1_Promise_0200 finish');
done();
return;
......
......@@ -28,4 +28,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
}
\ No newline at end of file
# 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("SimNoSimFunctionTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "SimNoSimFunctionTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册