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

!7391 电话用例整改

Merge pull request !7391 from zhangfuzhi/master
...@@ -144,12 +144,12 @@ describe('ActsNetworkSearchTest', function () { ...@@ -144,12 +144,12 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getSignalInformation_Async_0400', 0, async function (done) { it('Telephony_NetworkSearch_getSignalInformation_Async_0400', 0, async function (done) {
radio.getSignalInformation(SLOT_2, (err, data) => { radio.getSignalInformation(SLOT_2, (err, data) => {
if (err) { if (err) {
console.info(`Telephony_NetworkSearch_getSignalInformation_Async_0400 fail err: ${err}`); console.info('Telephony_NetworkSearch_getSignalInformation_Async_0400 fail err:' + JSON.stringify(err));
expect(err.code).assertEqual(202); expect(err.code).assertEqual(8300001);
done(); done();
return; return;
} }
console.info(`getSignalInformation_Async_0400 data: ${JSON.stringify(data)}`); console.info('getSignalInformation_Async_0400 data: ' + JSON.stringify(data));
if (data.length > 0) { if (data.length > 0) {
expect(data[0].signalLevel != -1).assertTrue(); expect(data[0].signalLevel != -1).assertTrue();
expect(data[0].signalType != radio.NETWORK_TYPE_WCDMA).assertTrue(); expect(data[0].signalType != radio.NETWORK_TYPE_WCDMA).assertTrue();
...@@ -167,13 +167,13 @@ describe('ActsNetworkSearchTest', function () { ...@@ -167,13 +167,13 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400', 0, async function (done) { it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400', 0, async function (done) {
radio.getISOCountryCodeForNetwork(SLOT_2, (err, data) => { radio.getISOCountryCodeForNetwork(SLOT_2, (err, data) => {
if (err) { if (err) {
console.info(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400 fail err: ${err}`); console.info('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400 fail err:' + JSON.stringify(err));
expect(err.code).assertEqual(202); expect(err.code).assertEqual(8300001);
done(); done();
return; return;
} }
console.info( console.info(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400 finish data: ${JSON.stringify(data)}`); 'Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400 finish data: ' + JSON.stringify(data));
expect(data.length === 0).assertTrue(); expect(data.length === 0).assertTrue();
done(); done();
}); });
...@@ -188,12 +188,12 @@ describe('ActsNetworkSearchTest', function () { ...@@ -188,12 +188,12 @@ describe('ActsNetworkSearchTest', function () {
try { try {
let data = await radio.getISOCountryCodeForNetwork(SLOT_2); let data = await radio.getISOCountryCodeForNetwork(SLOT_2);
console.info( console.info(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 finish data:${JSON.stringify(data)}`); 'Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 finish data:' + JSON.stringify(data));
expect(data.length === 0).assertTrue(); expect(data.length === 0).assertTrue();
done(); done();
} catch (err) { } catch (err) {
console.info(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 fail err: ${err}`); console.info('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 fail err:' + JSON.stringify(err));
expect(err.code).assertEqual(202); expect(err.code).assertEqual(8300001);
done(); done();
return; return;
} }
...@@ -285,11 +285,11 @@ describe('ActsNetworkSearchTest', function () { ...@@ -285,11 +285,11 @@ describe('ActsNetworkSearchTest', function () {
try { try {
let data = await radio.getSignalInformation(SLOT_2); let data = await radio.getSignalInformation(SLOT_2);
console.info( console.info(
`Telephony_NetworkSearch_getSignalInformation_Promise_0400 finish data: ${JSON.stringify(data)}`); 'Telephony_NetworkSearch_getSignalInformation_Promise_0400 finish data: ' + JSON.stringify(data));
expect(data.length === 0).assertTrue(); expect(data.length === 0).assertTrue();
} catch (err) { } catch (err) {
console.info(`Telephony_NetworkSearch_getSignalInformation_Promise_0400 fail err: ${err}`); console.info('Telephony_NetworkSearch_getSignalInformation_Promise_0400 fail err: ' + JSON.stringify(err));
expect(err.code).assertEqual(202); expect(err.code).assertEqual(8300001);
done(); done();
return; return;
} }
...@@ -304,12 +304,12 @@ describe('ActsNetworkSearchTest', function () { ...@@ -304,12 +304,12 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getOperatorName_Async_0400', 0, async function (done) { it('Telephony_NetworkSearch_getOperatorName_Async_0400', 0, async function (done) {
radio.getOperatorName(SLOT_2, (err, data) => { radio.getOperatorName(SLOT_2, (err, data) => {
if (err) { if (err) {
console.info(`Telephony_NetworkSearch_getOperatorName_Async_0400 fail err: ${err}`); console.info('Telephony_NetworkSearch_getOperatorName_Async_0400 fail err:' + JSON.stringify(err));
expect(err.code).assertEqual(202); expect(err.code).assertEqual(8300001);
done(); done();
return; return;
} }
console.info(`Telephony_NetworkSearch_getOperatorName_Async_0400 finish data: ${data}`); console.info('Telephony_NetworkSearch_getOperatorName_Async_0400 finish data:' + data);
expect(data === '').assertTrue(); expect(data === '').assertTrue();
done(); done();
}) })
...@@ -323,12 +323,12 @@ describe('ActsNetworkSearchTest', function () { ...@@ -323,12 +323,12 @@ describe('ActsNetworkSearchTest', function () {
it('Telephony_NetworkSearch_getOperatorName_Promise_0400', 0, async function (done) { it('Telephony_NetworkSearch_getOperatorName_Promise_0400', 0, async function (done) {
try { try {
let data = await radio.getOperatorName(SLOT_2); let data = await radio.getOperatorName(SLOT_2);
console.info(`Telephony_NetworkSearch_getOperatorName_Promise_0400 finish data: ${data}`); console.info('Telephony_NetworkSearch_getOperatorName_Promise_0400 finish data: ' + data);
expect(data === '').assertTrue(); expect(data === '').assertTrue();
done(); done();
} catch (err) { } catch (err) {
console.info(`Telephony_NetworkSearch_getOperatorName_Promise_0400 fail err: ${err}`); console.info('Telephony_NetworkSearch_getOperatorName_Promise_0400 fail err: ' + JSON.stringify(err));
expect(err.code).assertEqual(202); expect(err.code).assertEqual(8300001);
done(); done();
} }
}) })
...@@ -379,6 +379,7 @@ describe('ActsNetworkSearchTest', function () { ...@@ -379,6 +379,7 @@ describe('ActsNetworkSearchTest', function () {
radio.isRadioOn((err, data) => { radio.isRadioOn((err, data) => {
if (err) { if (err) {
console.error('When the device has no modem, the interface reports an error' + JSON.stringify(err)); console.error('When the device has no modem, the interface reports an error' + JSON.stringify(err));
expect(err.code).assertEqual(8300000);
done(); done();
return; return;
} }
...@@ -395,12 +396,10 @@ describe('ActsNetworkSearchTest', function () { ...@@ -395,12 +396,10 @@ describe('ActsNetworkSearchTest', function () {
*/ */
it('Telephony_NetworkSearch_isRadioOn_Promise_0200', 0, async function (done) { it('Telephony_NetworkSearch_isRadioOn_Promise_0200', 0, async function (done) {
try { try {
let data = await radio.isRadioOn(); await radio.isRadioOn();
console.info('Telephony_NetworkSearch_isRadioOn_Promise_0200 finish ' + JSON.stringify(data));
expect(data == true).assertTrue();
done();
} catch (err) { } catch (err) {
console.error('When the device has no modem, the interface reports an error' + JSON.stringify(err)); console.error('When the device has no modem, the interface reports an error' + JSON.stringify(err));
expect(err.code).assertEqual(8300000);
done(); done();
} }
}); });
...@@ -411,13 +410,14 @@ describe('ActsNetworkSearchTest', function () { ...@@ -411,13 +410,14 @@ describe('ActsNetworkSearchTest', function () {
* @tc.desc Test isRadioOn api by callback. * @tc.desc Test isRadioOn api by callback.
*/ */
it('Telephony_NetworkSearch_isRadioOn_Async_0300', 0, async function (done) { it('Telephony_NetworkSearch_isRadioOn_Async_0300', 0, async function (done) {
radio.isRadioOn(0, (err, data) => { radio.isRadioOn(0, (err,data) => {
if (err) { if (err) {
console.error('When the device has no modem, the interface reports an error' + JSON.stringify(err)); console.error('When the device has no modem, the interface reports an error' + JSON.stringify(err));
expect(err.code).assertEqual(8300000);
done(); done();
return; return;
} }
console.info('Telephony_NetworkSearch_isRadioOn_Async_0300 finish ' + JSON.stringify(data)); console.info('Telephony_NetworkSearch_isRadioOn_Async_0300 finish ' + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
done(); done();
}); });
...@@ -432,10 +432,9 @@ describe('ActsNetworkSearchTest', function () { ...@@ -432,10 +432,9 @@ describe('ActsNetworkSearchTest', function () {
try { try {
let data = await radio.isRadioOn(0); let data = await radio.isRadioOn(0);
console.info('Telephony_NetworkSearch_isRadioOn_Promise_0300 finish ' + JSON.stringify(data)); console.info('Telephony_NetworkSearch_isRadioOn_Promise_0300 finish ' + JSON.stringify(data));
expect(data == true).assertTrue();
done();
} catch (err) { } catch (err) {
console.error('When the device has no modem, the interface reports an error' + JSON.stringify(err)); console.error('When the device has no modem, the interface reports an error' + JSON.stringify(err));
expect(err.code).assertEqual(8300000);
done(); done();
} }
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册