Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
7894efaa
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看板
提交
7894efaa
编写于
7月 14, 2023
作者:
J
jianghuanhuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
telephony-接口用例补充
Signed-off-by:
N
jianghuanhuan
<
jianghuanhuan@huawei.com
>
上级
d7635faf
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
202 addition
and
0 deletion
+202
-0
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/DataJsunit.test.ets
...adiostatistic/entry/src/main/ets/test/DataJsunit.test.ets
+15
-0
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/SmsMmsJsunit.test.ets
...iostatistic/entry/src/main/ets/test/SmsMmsJsunit.test.ets
+47
-0
telephony/telephonyjstest/sim/sim_manager_function_test/src/main/js/test/SimManager.test.js
...manager_function_test/src/main/js/test/SimManager.test.js
+140
-0
未找到文件。
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/DataJsunit.test.ets
浏览文件 @
7894efaa
...
...
@@ -158,6 +158,21 @@ export default function dataJsunit() {
console.log(`==========> ${caseName} Test end ==========>`);
done();
});
/**
* @tc.number Telephony_Data_DefaultCellularDataSimId_DATA_GET_SimId
* @tc.name Enum DataConnectState
* @tc.desc Enum value test
*/
it("Telephony_Data_DefaultCellularDataSimId_DATA_GET_SimId", 0, async function (done) {
let caseName = 'Telephony_Data_DefaultCellularDataSimId_DATA_GET_SimId';
console.log(`==========> ${caseName} Test start ==========>`);
console.log("Result: "+ data.getDefaultCellularDataSimId());
expect(true).assertTrue();
console.log(`==========> ${caseName} Test end ==========>`);
done();
});
});
}
...
...
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/SmsMmsJsunit.test.ets
浏览文件 @
7894efaa
...
...
@@ -14,6 +14,7 @@
*/
import { describe, expect, it } from '@ohos/hypium';
import sms from '@ohos.telephony.sms';
import radio from '@ohos.telephony.radio';
export default function smsUiJsunit() {
describe('smsUiJsunit', function () {
...
...
@@ -120,5 +121,51 @@ export default function smsUiJsunit() {
expect(sms.ShortMessageClass.FORWARD_MESSAGE == 4).assertTrue();
done();
});
/**
* @tc.number Telephony_Sms_getDefaultSmsSimId_CallBack_0100
* @tc.name Test getOpName interface
* @tc.desc
*/
it('Telephony_Sms_getDefaultSmsSimId_CallBack_0100', 0, async function (done) {
sms.getDefaultSmsSimId((err, data) => {
if(err){
console.info("Telephony_Sms_getDefaultSmsSimId_CallBack_0100 err = " + JSON.stringify(data));
radio.isRadioOn(0, (err, data) => {
console.info('Telephony_Sms_getDefaultSmsSimId_CallBack_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data));
if (!err) {
expect().assertFail();
}
});
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.name Test getOpName interface
* @tc.desc
*/
it('Telephony_Sms_getDefaultSmsSimId_Promise_0100', 0, async function (done) {
let promise = sms.getDefaultSmsSimId();
promise.then(data => {
console.info("Telephony_Sms_getDefaultSmsSimId_Promise_0100 data = " + JSON.stringify(data));
expect(true).assertTrue();
done();
}).catch(err => {
console.info("Telephony_Sms_getDefaultSmsSimId_Promise_0100 err = " + JSON.stringify(err));
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();
}
});
done();
});
});
})
}
telephony/telephonyjstest/sim/sim_manager_function_test/src/main/js/test/SimManager.test.js
浏览文件 @
7894efaa
...
...
@@ -14,6 +14,7 @@
*/
import
sim
from
'
@ohos.telephony.sim
'
;
import
radio
from
'
@ohos.telephony.radio
'
;
import
*
as
env
from
'
./lib/Const
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
export
default
function
SimManagerTest
()
{
...
...
@@ -496,5 +497,144 @@ describe('SimManagerTest', function () {
done
();
});
});
/**
* @tc.number Telephony_Sim_getSimAccountInfo_CallBack_0100
* @tc.name Test getOpName interface
* @tc.desc
*/
it
(
'
Telephony_Sim_getSimAccountInfo_CallBack_0100
'
,
0
,
async
function
(
done
)
{
sim
.
getSimAccountInfo
(
0
,
(
err
,
data
)
=>
{
if
(
err
){
console
.
info
(
"
Telephony_Sim_getSimAccountInfo_CallBack_0100 err =
"
+
JSON
.
stringify
(
err
));
radio
.
isRadioOn
(
0
,
(
err
,
data
)
=>
{
console
.
info
(
'
Telephony_Sim_getSimAccountInfo_CallBack_0100 isRadioOn err
'
+
JSON
.
stringify
(
err
)
+
'
data
'
+
JSON
.
stringify
(
data
));
if
(
!
err
)
{
expect
().
assertFail
();
}
});
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.name Test getOpName interface
* @tc.desc
*/
it
(
'
Telephony_Sim_getSimAccountInfo_Promise_0100
'
,
0
,
async
function
(
done
)
{
let
promise
=
sim
.
getSimAccountInfo
(
0
);
promise
.
then
(
data
=>
{
console
.
info
(
"
Telephony_Sim_getSimAccountInfo_Promise_0100 data =
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertTrue
();
done
();
}).
catch
(
err
=>
{
console
.
info
(
"
Telephony_Sim_getSimAccountInfo_Promise_0100 err =
"
+
JSON
.
stringify
(
err
));
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
();
}
});
done
();
});
});
/**
* @tc.number Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100
* @tc.name Test getOpName interface
* @tc.desc
*/
it
(
'
Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100
'
,
0
,
async
function
(
done
)
{
sim
.
getActiveSimAccountInfoList
((
err
,
data
)
=>
{
if
(
err
){
console
.
info
(
"
Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100 err =
"
+
JSON
.
stringify
(
err
));
radio
.
isRadioOn
(
0
,
(
err
,
data
)
=>
{
console
.
info
(
'
Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100 isRadioOn err
'
+
JSON
.
stringify
(
err
)
+
'
data
'
+
JSON
.
stringify
(
data
));
if
(
!
err
)
{
expect
().
assertFail
();
}
});
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.name Test getOpName interface
* @tc.desc
*/
it
(
'
Telephony_Sim_getActiveSimAccountInfoList_Promise_0100
'
,
0
,
async
function
(
done
)
{
let
promise
=
sim
.
getActiveSimAccountInfoList
();
promise
.
then
(
data
=>
{
console
.
info
(
"
Telephony_Sim_getActiveSimAccountInfoList_Promise_0100 data =
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertTrue
();
done
();
}).
catch
(
err
=>
{
console
.
info
(
"
Telephony_Sim_getActiveSimAccountInfoList_Promise_0100 err =
"
+
JSON
.
stringify
(
err
));
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
();
}
});
done
();
});
});
/**
* @tc.number Telephony_Sim_getDefaultVoiceSimId_CallBack_0100
* @tc.name Test getOpName interface
* @tc.desc
*/
it
(
'
Telephony_Sim_getDefaultVoiceSimId_CallBack_0100
'
,
0
,
async
function
(
done
)
{
sim
.
getDefaultVoiceSimId
((
err
,
data
)
=>
{
if
(
err
){
console
.
info
(
"
Telephony_Sim_getDefaultVoiceSimId_CallBack_0100 err =
"
+
JSON
.
stringify
(
err
));
radio
.
isRadioOn
(
0
,
(
err
,
data
)
=>
{
console
.
info
(
'
Telephony_Sim_getDefaultVoiceSimId_CallBack_0100 isRadioOn err
'
+
JSON
.
stringify
(
err
)
+
'
data
'
+
JSON
.
stringify
(
data
));
if
(
!
err
)
{
expect
().
assertFail
();
}
});
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.name Test getOpName interface
* @tc.desc
*/
it
(
'
Telephony_Sim_getDefaultVoiceSimId_Promise_0100
'
,
0
,
async
function
(
done
)
{
let
promise
=
sim
.
getDefaultVoiceSimId
();
promise
.
then
(
data
=>
{
console
.
info
(
"
Telephony_Sim_getDefaultVoiceSimId_Promise_0100 data =
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertTrue
();
done
();
}).
catch
(
err
=>
{
console
.
info
(
"
Telephony_Sim_getDefaultVoiceSimId_Promise_0100 err =
"
+
JSON
.
stringify
(
err
));
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
();
}
});
done
();
});
});
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录