Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9a6098db
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9a6098db
编写于
6月 28, 2022
作者:
G
gaoxi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
电话问题修改,接口覆盖
Signed-off-by:
N
gaoxi
<
gaoxi785@huawei.com
>
上级
baf0122f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
143 addition
and
128 deletion
+143
-128
telephony/telephonyjstest/netmanager_base/network_nopermission/entry/src/main/config.json
...ager_base/network_nopermission/entry/src/main/config.json
+1
-1
telephony/telephonyjstest/netmanager_base/network_nowifi/entry/src/main/config.json
...netmanager_base/network_nowifi/entry/src/main/config.json
+1
-1
telephony/telephonyjstest/netmanager_base/network_wifi/entry/src/main/config.json
...t/netmanager_base/network_wifi/entry/src/main/config.json
+1
-1
telephony/telephonyjstest/netmanager_base/system_fetch/entry/src/main/config.json
...t/netmanager_base/system_fetch/entry/src/main/config.json
+1
-1
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/RadioSecondJsunit.test.ets
.../src/main/ets/MainAbility/test/RadioSecondJsunit.test.ets
+132
-120
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/SmsMmsJsunit.test.ets
...entry/src/main/ets/MainAbility/test/SmsMmsJsunit.test.ets
+7
-4
未找到文件。
telephony/telephonyjstest/netmanager_base/network_nopermission/entry/src/main/config.json
浏览文件 @
9a6098db
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
"pages"
:
[
"pages"
:
[
"pages/index/index"
"pages/index/index"
],
],
"name"
:
"
.MainAbility
"
,
"name"
:
"
default
"
,
"window"
:
{
"window"
:
{
"designWidth"
:
720
,
"designWidth"
:
720
,
"autoDesignWidth"
:
false
"autoDesignWidth"
:
false
...
...
telephony/telephonyjstest/netmanager_base/network_nowifi/entry/src/main/config.json
浏览文件 @
9a6098db
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
"pages"
:
[
"pages"
:
[
"pages/index/index"
"pages/index/index"
],
],
"name"
:
"
.MainAbility
"
,
"name"
:
"
default
"
,
"window"
:
{
"window"
:
{
"designWidth"
:
720
,
"designWidth"
:
720
,
"autoDesignWidth"
:
false
"autoDesignWidth"
:
false
...
...
telephony/telephonyjstest/netmanager_base/network_wifi/entry/src/main/config.json
浏览文件 @
9a6098db
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
"pages"
:
[
"pages"
:
[
"pages/index/index"
"pages/index/index"
],
],
"name"
:
"
.MainAbility
"
,
"name"
:
"
default
"
,
"window"
:
{
"window"
:
{
"designWidth"
:
720
,
"designWidth"
:
720
,
"autoDesignWidth"
:
false
"autoDesignWidth"
:
false
...
...
telephony/telephonyjstest/netmanager_base/system_fetch/entry/src/main/config.json
浏览文件 @
9a6098db
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
"pages"
:
[
"pages"
:
[
"pages/index/index"
"pages/index/index"
],
],
"name"
:
"
.MainAbility
"
,
"name"
:
"
default
"
,
"window"
:
{
"window"
:
{
"designWidth"
:
720
,
"designWidth"
:
720
,
"autoDesignWidth"
:
false
"autoDesignWidth"
:
false
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/RadioSecondJsunit.test.ets
浏览文件 @
9a6098db
// @ts-nocheck
/**
/**
* Copyright (c) 202
2
Huawei Device Co., Ltd.
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -12,7 +13,7 @@
...
@@ -12,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index
.ets
";
import radio from '@ohos.telephony.radio';
import radio from '@ohos.telephony.radio';
import utils from './Utils.ets'
import utils from './Utils.ets'
...
@@ -64,12 +65,14 @@ export default function radioSecondJsunit() {
...
@@ -64,12 +65,14 @@ export default function radioSecondJsunit() {
const CELL_INFO_MIN = 0;
const CELL_INFO_MIN = 0;
const TIME_RADIO_TURNON = 10000;
const TIME_RADIO_TURNON = 10000;
console.log("************* radio Test start*************");
console.log("************* radio Test start*************");
/**
/**
* @tc.number Telephony_NetworkSearch_NetworkState_Async_0100
* @tc.number Telephony_NetworkSearch_NetworkState_Async_0100
* @tc.name Test getNrOptionMode() to check the callback result
* @tc.name Test getNrOptionMode() to check the callback result
* @tc.desc Function test
* @tc.desc Function test
*/
*/
it('Telephony_NetworkSearch_NetworkState_Async_0100', 0, async function (done) {
it('Telephony_NetworkSearch_NetworkState_Async_0100', 0, async function (done) {
if (utils.notCheck) {
if (utils.notCheck) {
expect(true).assertTrue();
expect(true).assertTrue();
...
@@ -119,11 +122,11 @@ export default function radioSecondJsunit() {
...
@@ -119,11 +122,11 @@ export default function radioSecondJsunit() {
done();
done();
})
})
/**
/**
* @tc.number Telephony_NetworkSearch_NetworkState_Async_0200
* @tc.number Telephony_NetworkSearch_NetworkState_Async_0200
* @tc.name testGetNetworkState_0200
* @tc.name testGetNetworkState_0200
* @tc.desc Test getNetworkState() api by callback, slotId is 0, to check the callback result
* @tc.desc Test getNetworkState() api by callback, slotId is 0, to check the callback result
*/
*/
it('Telephony_NetworkSearch_NetworkState_Async_0200', 0, async function (done) {
it('Telephony_NetworkSearch_NetworkState_Async_0200', 0, async function (done) {
if (utils.notCheck) {
if (utils.notCheck) {
expect(true).assertTrue();
expect(true).assertTrue();
...
@@ -192,41 +195,34 @@ export default function radioSecondJsunit() {
...
@@ -192,41 +195,34 @@ export default function radioSecondJsunit() {
})
})
/**
/**
* @tc.number
Telephony_NetworkSearch_getRadioTech_Async_0500
* @tc.number
Telephony_NetworkSearch_getRadioTech_Async_0500
* @tc.name
TestGetRadioTech_0500
* @tc.name
TestGetRadioTech_0500
* @tc.desc Test getRadioTech() api by callback,
SlotId parameter input is 0
* @tc.desc Test getRadioTech() api by callback .
SlotId parameter input is 0
*/
*/
it("Telephony_NetworkSearch_getRadioTech_Async_0500", 0, async function(done){
it("Telephony_NetworkSearch_getRadioTech_Async_0500", 0, async function(done){
radio.getRadioTech(0, (err, data) => {
let slotId = 0;
if (err) {
radio.getRadioTech(slotId, (err, data) =>{
console.info(`Telephony_NetworkSearch_getRadioTech_Async_0500 fail err: ${err}`);
expect(JSON.stringify(data) != null).assertTrue();
expect(err.code === '-1').assertTrue();
console.info(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
done();
});
return;
done();
}
console.info(`Telephony_NetworkSearch_getRadioTech_Async_0500 success ${data}`);
expect(true).assertTrue();
done();
});
});
});
/**
/**
* @tc.number
Telephony_NetworkSearch_getRadioTech_Promise_0500
* @tc.number
Telephony_NetworkSearch_getRadioTech_Promise_0500
* @tc.name t
estGetRadioTech_0500
* @tc.name T
estGetRadioTech_0500
* @tc.desc SlotId parameter input is 0, test getRadioTech() api by promise.
* @tc.desc SlotId parameter input is 0 ,Test getRadioTech() api by promise
*/
*/
it("Telephony_NetworkSearch_getRadioTech_Promise_0500", 0, async function(done){
it("Telephony_NetworkSearch_getRadioTech_Promise_0500", 0, async function(done){
try {
let slotId = 0;
let data = await radio.getRadioTech(0);
let promise = radio.getRadioTech(slotId);
console.log(`Telephony_NetworkSearch_getRadioTech_Promise_0500 success`);
promise.then(data => {
expect(true).assertTrue();
expect(JSON.stringify(data) != null).assertTrue();
done();
console.info(`getRadioTech success, data->${JSON.stringify(data)}`);
} catch (err) {
}).catch(err => {
console.log(`Telephony_NetworkSearch_getRadioTech_Promise_0500 fail err: ${err}`);
console.info(`getRadioTech fail, err->${JSON.stringify(err)}`);
expect(err.code === '-1').assertTrue();
});
done();
done();
return;
}
});
});
/**
/**
...
@@ -235,23 +231,23 @@ export default function radioSecondJsunit() {
...
@@ -235,23 +231,23 @@ export default function radioSecondJsunit() {
* @tc.desc SlotId parameter input is 0, test getNetworkSelectionMode() api by callback.
* @tc.desc SlotId parameter input is 0, test getNetworkSelectionMode() api by callback.
*/
*/
it('Telephony_NetworkSearch_getNetworkSelectionMode_Async_0600', 0, async function (done) {
it('Telephony_NetworkSearch_getNetworkSelectionMode_Async_0600', 0, async function (done) {
if (utils.notCheck) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
radio.getNetworkSelectionMode(0, (err, res) => {
if (err) {
console.log(`Telephony_NetworkSearch_getNetworkSelectionMode_Async_0600 err: ${err}`);
expect().assertFail();
done();
} else {
console.log('Telephony_NetworkSearch_getNetworkSelectionMode_Async_0600 pass ${res}');
expect(true).assertTrue();
expect(true).assertTrue();
done();
done();
return;
}
}
radio.getNetworkSelectionMode(0, (err, res) => {
if (err) {
console.log(`Telephony_NetworkSearch_getNetworkSelectionMode_Async_0600 err: ${err}`);
expect().assertFail();
done();
} else {
console.log('Telephony_NetworkSearch_getNetworkSelectionMode_Async_0600 pass ${res}');
expect(true).assertTrue();
done();
}
});
});
});
});
/**
/**
...
@@ -260,22 +256,22 @@ export default function radioSecondJsunit() {
...
@@ -260,22 +256,22 @@ export default function radioSecondJsunit() {
* @tc.desc SlotId parameter input is 0, test getNetworkSelectionMode() api by promise.
* @tc.desc SlotId parameter input is 0, test getNetworkSelectionMode() api by promise.
*/
*/
it('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0600', 0, async function (done) {
it('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0600', 0, async function (done) {
if (utils.notCheck) {
if (utils.notCheck) {
expect(true).assertTrue();
expect(true).assertTrue();
done();
return;
}
try {
await radio.getNetworkSelectionMode(0);
console.log('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0600 pass');
expect(true).assertTrue();
} catch (err) {
console.log('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0600 fail: ${err}');
expect().assertFail();
done();
return;
}
done();
done();
return;
}
try {
await radio.getNetworkSelectionMode(0);
console.log('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0600 pass');
expect(true).assertTrue();
} catch (err) {
console.log('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0600 fail: ${err}');
expect().assertFail();
done();
return;
}
done();
});
});
/**
/**
...
@@ -284,18 +280,23 @@ export default function radioSecondJsunit() {
...
@@ -284,18 +280,23 @@ export default function radioSecondJsunit() {
* @tc.desc SlotId parameter input is 0, test getISOCountryCodeForNetwork() api by callback.
* @tc.desc SlotId parameter input is 0, test getISOCountryCodeForNetwork() api by callback.
*/
*/
it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0500', 0, async function (done) {
it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0500', 0, async function (done) {
radio.getISOCountryCodeForNetwork(0, (err, data) => {
if (utils.notCheck) {
if (err) {
expect(true).assertTrue();
console.log(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0500 fail err: ${err}`);
done();
expect().assertFail();
return;
done();
}
return;
radio.getISOCountryCodeForNetwork(0, (err, data) => {
}
if (err) {
console.log(
console.log(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0500 fail err: ${err}`);
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0500 finish data: ${JSON.stringify(data)}`);
expect().assertFail();
expect(true).assertTrue();
done();
done();
return;
});
}
console.log(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0500 finish data: ${JSON.stringify(data)}`);
expect(true).assertTrue();
done();
});
});
});
/**
/**
...
@@ -304,18 +305,23 @@ export default function radioSecondJsunit() {
...
@@ -304,18 +305,23 @@ export default function radioSecondJsunit() {
* @tc.desc SlotId parameter input is 0, test getISOCountryCodeForNetwork() api by promise.
* @tc.desc SlotId parameter input is 0, test getISOCountryCodeForNetwork() api by promise.
*/
*/
it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0500', 0, async function (done) {
it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0500', 0, async function (done) {
try {
if (utils.notCheck) {
let data = await radio.getISOCountryCodeForNetwork(0);
expect(true).assertTrue();
console.log(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0500 finish data:${JSON.stringify(data)}`);
expect(true).assertTrue();
} catch (err) {
console.log(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0500 fail err: ${err}`);
expect().assertFail();
done();
return;
}
done();
done();
return;
}
try {
let data = await radio.getISOCountryCodeForNetwork(0);
console.log(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0500 finish data:${JSON.stringify(data)}`);
expect(true).assertTrue();
} catch (err) {
console.log(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0500 fail err: ${err}`);
expect().assertFail();
done();
return;
}
done();
});
});
/**
/**
...
@@ -324,17 +330,22 @@ export default function radioSecondJsunit() {
...
@@ -324,17 +330,22 @@ export default function radioSecondJsunit() {
* @tc.desc SlotId parameter input is 0, test getSignalInformation() api by callback.
* @tc.desc SlotId parameter input is 0, test getSignalInformation() api by callback.
*/
*/
it('Telephony_NetworkSearch_getSignalInformation_Async_0500', 0, async function (done) {
it('Telephony_NetworkSearch_getSignalInformation_Async_0500', 0, async function (done) {
radio.getSignalInformation(0, (err, data) => {
if (utils.notCheck) {
if (err) {
expect(true).assertTrue();
console.log(`Telephony_NetworkSearch_getSignalInformation_Async_0500 fail err: ${err}`);
done();
expect().assertFail();
return;
done();
}
return;
radio.getSignalInformation(0, (err, data) => {
}
if (err) {
console.log(`Telephony_NetworkSearch_getSignalInformation_Async_0500 finish data: ${JSON.stringify(data)}`);
console.log(`Telephony_NetworkSearch_getSignalInformation_Async_0500 fail err: ${err}`);
expect(true).assertTrue();
expect().assertFail();
done();
done();
});
return;
}
console.log(`Telephony_NetworkSearch_getSignalInformation_Async_0500 finish data: ${JSON.stringify(data)}`);
expect(true).assertTrue();
done();
});
});
});
/**
/**
...
@@ -343,24 +354,25 @@ export default function radioSecondJsunit() {
...
@@ -343,24 +354,25 @@ export default function radioSecondJsunit() {
* @tc.desc SlotId parameter input is 0, test getSignalInformation() api by promise.
* @tc.desc SlotId parameter input is 0, test getSignalInformation() api by promise.
*/
*/
it('Telephony_NetworkSearch_getSignalInformation_Promise_0500', 0, async function (done) {
it('Telephony_NetworkSearch_getSignalInformation_Promise_0500', 0, async function (done) {
try {
if (utils.notCheck) {
let data = await radio.getSignalInformation(0);
expect(true).assertTrue();
console.log(
`Telephony_NetworkSearch_getSignalInformation_Promise_0500 pass data: ${JSON.stringify(data)}`);
expect(true).assertTrue();
} catch (err) {
console.log(`Telephony_NetworkSearch_getSignalInformation_Promise_0500 fail err: ${err}`);
expect().assertFail();
done();
return;
}
done();
done();
return;
}
try {
let data = await radio.getSignalInformation(0);
console.log(
`Telephony_NetworkSearch_getSignalInformation_Promise_0500 pass data: ${JSON.stringify(data)}`);
expect(true).assertTrue();
} catch (err) {
console.log(`Telephony_NetworkSearch_getSignalInformation_Promise_0500 fail err: ${err}`);
expect().assertFail();
done();
return;
}
done();
});
});
console.log("************* radio Test end*************");
console.log("************* radio Test end*************");
function assertCellInformation(data) {
function assertCellInformation(data) {
expect(data !== '' && data != undefined && data != null).assertTrue();
expect(data !== '' && data != undefined && data != null).assertTrue();
...
@@ -403,7 +415,7 @@ export default function radioSecondJsunit() {
...
@@ -403,7 +415,7 @@ export default function radioSecondJsunit() {
expect(data[i].data.bsic >= CELL_INFO_MIN && data[i].data.bsic <= CELL_BSIC_MAX).assertTrue();
expect(data[i].data.bsic >= CELL_INFO_MIN && data[i].data.bsic <= CELL_BSIC_MAX).assertTrue();
expect(data[i].data.nid >= CELL_INFO_MIN && data[i].data.nid <= CELL_MNC_MAX).assertTrue();
expect(data[i].data.nid >= CELL_INFO_MIN && data[i].data.nid <= CELL_MNC_MAX).assertTrue();
expect(data[i].data.mcc).assertEqual(CELL_MCC);
expect(data[i].data.mcc).assertEqual(CELL_MCC);
} else if (data[i].networkType === radio.NETWORK_TYPE_NR) {
} else if (data[i].networkType === radio.NETWORK_TYPE_NR) {
expect(data[i].data.nrArfcn >= CELL_INFO_MIN && data[i].data.nrArfcn <= CELL_LAC_TAC_MAX).assertTrue();
expect(data[i].data.nrArfcn >= CELL_INFO_MIN && data[i].data.nrArfcn <= CELL_LAC_TAC_MAX).assertTrue();
expect(data[i].data.tac >= CELL_INFO_MIN && data[i].data.tac <= CELL_GSM_CELLID_MAX).assertTrue();
expect(data[i].data.tac >= CELL_INFO_MIN && data[i].data.tac <= CELL_GSM_CELLID_MAX).assertTrue();
expect(data[i].data.nci >= CELL_INFO_MIN && data[i].data.nci <= CELL_ARFCN_MAX).assertTrue();
expect(data[i].data.nci >= CELL_INFO_MIN && data[i].data.nci <= CELL_ARFCN_MAX).assertTrue();
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/SmsMmsJsunit.test.ets
浏览文件 @
9a6098db
// @ts-nocheck
/**
/**
* Copyright (c) 202
2
Huawei Device Co., Ltd.
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -12,7 +13,7 @@
...
@@ -12,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index";
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index
.ets
";
import mms from '@ohos.telephony.sms';
import mms from '@ohos.telephony.sms';
import utils from './Utils.ets'
import utils from './Utils.ets'
export default function smsUiJsunit() {
export default function smsUiJsunit() {
...
@@ -137,8 +138,10 @@ export default function smsUiJsunit() {
...
@@ -137,8 +138,10 @@ export default function smsUiJsunit() {
done();
done();
return;
return;
}
}
expect(sms.SEND_SMS_FAILURE_RADIO_OFF == 0).assertTrue();
expect(sms.SEND_SMS_SUCCESS == 0).assertTrue();
expect(sms.SEND_SMS_FAILURE_SERVICE_UNAVAILABLE == 1).assertTrue();
expect(sms.SEND_SMS_FAILURE_UNKNOWN == 1).assertTrue();
expect(sms.SEND_SMS_FAILURE_RADIO_OFF == 2).assertTrue();
expect(sms.SEND_SMS_FAILURE_SERVICE_UNAVAILABLE == 3).assertTrue();
expect(sms.SIM_MESSAGE_STATUS_FREE == 0).assertTrue();
expect(sms.SIM_MESSAGE_STATUS_FREE == 0).assertTrue();
expect(sms.INSTANT_MESSAGE == 1).assertTrue();
expect(sms.INSTANT_MESSAGE == 1).assertTrue();
expect(sms.OPTIONAL_MESSAGE == 2).assertTrue();
expect(sms.OPTIONAL_MESSAGE == 2).assertTrue();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录