Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
af5da394
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看板
未验证
提交
af5da394
编写于
4月 24, 2022
作者:
O
openharmony_ci
提交者:
Gitee
4月 24, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2996 feat: 提供瞬时电压电流和电量等接口
Merge pull request !2996 from zhaoruiyuan/master
上级
c6d1bd57
9e723192
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
111 addition
and
0 deletion
+111
-0
powermgr/powermgrbattery/src/main/js/default/test/battery_unit.test.js
...rmgrbattery/src/main/js/default/test/battery_unit.test.js
+111
-0
未找到文件。
powermgr/powermgrbattery/src/main/js/default/test/battery_unit.test.js
浏览文件 @
af5da394
...
@@ -279,4 +279,115 @@ describe('appInfoTest', function () {
...
@@ -279,4 +279,115 @@ describe('appInfoTest', function () {
expect
(
isBatteryPresent
).
assertFalse
();
expect
(
isBatteryPresent
).
assertFalse
();
}
}
})
})
/**
* @tc.number battery_manager_js_2400
* @tc.name nowCurrent_test
* @tc.desc Battry Present Interface Test
*/
it
(
'
nowCurrent_test
'
,
0
,
function
()
{
let
nowCurrent
=
batteryInfo
.
nowCurrent
;
console
.
info
(
'
nowCurrent =
'
+
nowCurrent
);
expect
(
nowCurrent
>=
0
).
assertTrue
();
})
/**
* @tc.number battery_manager_js_2500
* @tc.name remainingEnergy_test
* @tc.desc Battry Present Interface Test
*/
it
(
'
remainingEnergy_test
'
,
0
,
function
()
{
let
remainingEnergy
=
batteryInfo
.
remainingEnergy
;
console
.
info
(
'
remEnergy =
'
+
remainingEnergy
);
expect
(
remainingEnergy
>=
0
).
assertTrue
();
})
/**
* @tc.number battery_manager_js_2600
* @tc.name totalEnergy_test
* @tc.desc Battry Present Interface Test
*/
it
(
'
totalEnergy_test
'
,
0
,
function
()
{
let
totalEnergy
=
batteryInfo
.
totalEnergy
;
console
.
info
(
'
totalenergy =
'
+
totalEnergy
);
expect
(
totalEnergy
>=
0
).
assertTrue
();
})
/**
* @tc.number battery_manager_js_2700
* @tc.name batterylevel_test
* @tc.desc Battry Present Interface Test
*/
it
(
'
batterylevel_test
'
,
0
,
function
()
{
let
batteryLevel
=
batteryInfo
.
batteryCapacityLevel
;
console
.
info
(
'
batteryLevel =
'
+
batteryLevel
);
expect
(
batteryLevel
>=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_NONE
&&
batteryLevel
<=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_CRITICAL
).
assertTrue
();
})
/**
* @tc.number battery_manager_js_2800
* @tc.name enum_level_state_test_none
* @tc.desc Battry Present Interface Test
*/
it
(
'
enum_level_state_test_none
'
,
0
,
function
()
{
let
batterylevelState
=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_NONE
;
console
.
info
(
'
batterylevelState =
'
+
batterylevelState
);
expect
(
batterylevelState
==
0
).
assertTrue
();
})
/**
* @tc.number battery_manager_js_2900
* @tc.name enum_level_state_test_full
* @tc.desc Battry Present Interface Test
*/
it
(
'
enum_level_state_test_full
'
,
0
,
function
()
{
let
batteryLevelState
=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_FULL
;
console
.
info
(
'
batteryLevelState =
'
+
batteryLevelState
);
expect
(
batteryLevelState
==
1
).
assertTrue
();
})
/**
* @tc.number battery_manager_js_3000
* @tc.name enum_level_state_test_high
* @tc.desc Battry Present Interface Test
*/
it
(
'
enum_level_state_test_high
'
,
0
,
function
()
{
let
batteryLevelState
=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_HIGH
;
console
.
info
(
'
batteryLevelState =
'
+
batteryLevelState
);
expect
(
batteryLevelState
==
2
).
assertTrue
();
})
/**
* @tc.number battery_manager_js_3100
* @tc.name enum_level_state_test_normal
* @tc.desc Battry Present Interface Test
*/
it
(
'
enum_level_state_test_normal
'
,
0
,
function
()
{
let
batteryLevelState
=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_NORMAL
;
console
.
info
(
'
batteryLevelState =
'
+
batteryLevelState
);
expect
(
batteryLevelState
==
3
).
assertTrue
();
})
/**
* @tc.number battery_manager_js_3200
* @tc.name enum_level_state_test_low
* @tc.desc Battry Present Interface Test
*/
it
(
'
enum_level_state_test_low
'
,
0
,
function
()
{
let
batteryLevelState
=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_LOW
;
console
.
info
(
'
batteryLevelState =
'
+
batteryLevelState
);
expect
(
batteryLevelState
==
4
).
assertTrue
();
})
/**
* @tc.number battery_manager_js_3300
* @tc.name enum_level_state_test_emergency
* @tc.desc Battry Present Interface Test
*/
it
(
'
enum_level_state_test_emergency
'
,
0
,
function
()
{
let
batteryLevelState
=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_CRITICAL
;
console
.
info
(
'
batteryLevelState =
'
+
batteryLevelState
);
expect
(
batteryLevelState
==
5
).
assertTrue
();
})
})
})
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录