Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
26872062
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看板
未验证
提交
26872062
编写于
6月 07, 2023
作者:
O
openharmony_ci
提交者:
Gitee
6月 07, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8937 【代码上库】【xts_acts】【powermgr】【master】 power test code optimization
Merge pull request !8937 from kangqiao/master
上级
b0d3a5d5
6e8fc62b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
130 addition
and
137 deletion
+130
-137
powermgr/battery_manager/src/main/js/test/system_battery.test.js
...r/battery_manager/src/main/js/test/system_battery.test.js
+130
-137
未找到文件。
powermgr/battery_manager/src/main/js/test/system_battery.test.js
浏览文件 @
26872062
...
...
@@ -39,158 +39,151 @@ function completeFunc(tag) {
}
export
default
function
SystemBatteryTest
()
{
describe
(
'
SystemBatteryTest
'
,
function
()
{
console
.
log
(
"
*************System Battery Unit Test Begin*************
"
);
describe
(
'
SystemBatteryTest
'
,
function
()
{
console
.
log
(
"
*************System Battery Unit Test Begin*************
"
);
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0010
* @tc.name get_status_success_test
* @tc.desc Battery acquisition kit
*/
const
successTest
=
"
get_status_success_test
"
;
it
(
successTest
,
0
,
function
()
{
battery
.
getStatus
(
{
success
:
(
data
)
=>
{
successFunc
(
data
,
successTest
);
},
fail
:
(
data
,
code
)
=>
{
failFunc
(
data
,
code
,
successTest
);
},
complete
:
()
=>
{
completeFunc
(
successTest
);
}
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0010
* @tc.name get_status_success_test
* @tc.desc Battery acquisition kit
*/
it
(
'
get_status_success_test
'
,
0
,
function
()
{
battery
.
getStatus
(
{
success
:
(
data
)
=>
{
successFunc
(
data
,
successTest
);
},
fail
:
(
data
,
code
)
=>
{
failFunc
(
data
,
code
,
successTest
);
},
complete
:
()
=>
{
completeFunc
(
successTest
);
}
}
);
});
});
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0020
* @tc.name get_status_success_null_test
* @tc.desc Battery acquisition kit
*/
const
successNullTest
=
"
get_status_success_null_test
"
;
it
(
successNullTest
,
0
,
function
()
{
battery
.
getStatus
({
success
:
null
,
fail
:
(
data
,
code
)
=>
{
failFunc
(
data
,
code
,
successNullTest
);
},
complete
:
()
=>
{
completeFunc
(
successNullTest
);
}
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0020
* @tc.name get_status_success_null_test
* @tc.desc Battery acquisition kit
*/
it
(
'
get_status_success_null_test
'
,
0
,
function
()
{
battery
.
getStatus
(
{
success
:
null
,
fail
:
(
data
,
code
)
=>
{
failFunc
(
data
,
code
,
successNullTest
);
},
complete
:
()
=>
{
completeFunc
(
successNullTest
);
}
}
);
});
});
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0030
* @tc.name get_status_success_empty_test
* @tc.desc Battery acquisition kit
*/
const
successEmptyTest
=
"
get_status_success_null_test
"
;
it
(
successEmptyTest
,
0
,
function
()
{
battery
.
getStatus
(
{
fail
:
(
data
,
code
)
=>
{
failFunc
(
data
,
code
,
successEmptyTest
);
},
complete
:
()
=>
{
completeFunc
(
successEmptyTest
);
}
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0030
* @tc.name get_status_success_empty_test
* @tc.desc Battery acquisition kit
*/
it
(
'
get_status_success_empty_test
'
,
0
,
function
()
{
battery
.
getStatus
(
{
fail
:
(
data
,
code
)
=>
{
failFunc
(
data
,
code
,
successEmptyTest
);
},
complete
:
()
=>
{
completeFunc
(
successEmptyTest
);
}
}
);
});
});
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0040
* @tc.name get_status_fail_null_test
* @tc.desc Battery acquisition kit
*/
let
failNullTest
=
"
get_status_fail_null_test
"
;
it
(
failNullTest
,
0
,
function
()
{
battery
.
getStatus
(
{
success
:
(
data
)
=>
{
successFunc
(
data
,
failNullTest
);
}
,
fail
:
null
,
complete
:
()
=>
{
completeFunc
(
failNullTest
);
}
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0040
* @tc.name get_status_fail_null_test
* @tc.desc Battery acquisition kit
*/
it
(
'
get_status_fail_null_test
'
,
0
,
function
()
{
battery
.
getStatus
(
{
success
:
(
data
)
=>
{
successFunc
(
data
,
failNullTest
);
},
fail
:
null
,
complete
:
()
=>
{
completeFunc
(
failNullTest
);
}
}
);
});
});
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0050
* @tc.name get_status_fail_empty_test
* @tc.desc Battery acquisition kit
*/
let
failEmptyTest
=
"
get_status_fail_empty_test
"
;
it
(
failEmptyTest
,
0
,
function
()
{
battery
.
getStatus
(
{
success
:
()
=>
{
successFunc
(
data
,
failEmptyTest
);
},
complete
:
()
=>
{
completeFunc
(
failEmptyTest
);
}
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0050
* @tc.name get_status_fail_empty_test
* @tc.desc Battery acquisition kit
*/
it
(
'
get_status_fail_empty_test
'
,
0
,
function
()
{
battery
.
getStatus
(
{
success
:
()
=>
{
successFunc
(
data
,
failEmptyTest
);
},
complete
:
()
=>
{
completeFunc
(
failEmptyTest
);
}
}
);
});
});
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0060
* @tc.name get_status_complete_null_test
* @tc.desc Battery acquisition kit
*/
let
completeNullTest
=
"
get_status_complete_null_test
"
;
it
(
completeNullTest
,
0
,
function
()
{
battery
.
getStatus
(
{
success
:
(
data
)
=>
{
successFunc
(
data
,
completeNullTest
);
},
fail
:
(
data
,
code
)
=>
{
failFunc
(
data
,
code
,
completeNullTest
);
},
complete
:
null
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0060
* @tc.name get_status_complete_null_test
* @tc.desc Battery acquisition kit
*/
it
(
'
get_status_complete_null_test
'
,
0
,
function
()
{
battery
.
getStatus
(
{
success
:
(
data
)
=>
{
successFunc
(
data
,
completeNullTest
);
},
fail
:
(
data
,
code
)
=>
{
failFunc
(
data
,
code
,
completeNullTest
);
},
complete
:
null
});
});
});
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0070
* @tc.name get_status_complete_empty_test
* @tc.desc Battery acquisition kit
*/
let
completeEmptyTest
=
"
get_status_complete_empty_test
"
;
it
(
completeEmptyTest
,
0
,
function
()
{
battery
.
getStatus
(
{
success
:
(
data
)
=>
{
successFunc
(
data
,
completeEmptyTest
);
},
fail
:
(
data
,
code
)
=>
{
failFunc
(
data
,
code
,
completeEmptyTest
);
}
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0070
* @tc.name get_status_complete_empty_test
* @tc.desc Battery acquisition kit
*/
it
(
'
get_status_complete_empty_test
'
,
0
,
function
()
{
battery
.
getStatus
(
{
success
:
(
data
)
=>
{
successFunc
(
data
,
completeEmptyTest
);
},
fail
:
(
data
,
code
)
=>
{
failFunc
(
data
,
code
,
completeEmptyTest
);
}
}
);
});
});
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0080
* @tc.name get_status_all_null
* @tc.desc Battery acquisition kit
*/
it
(
'
get_status_all_null
'
,
0
,
function
()
{
let
allNull
=
false
;
battery
.
getStatus
({
success
:
null
,
fail
:
null
,
complete
:
null
,
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0080
* @tc.name get_status_all_null
* @tc.desc Battery acquisition kit
*/
it
(
'
get_status_all_null
'
,
0
,
function
()
{
let
allNull
=
false
;
battery
.
getStatus
({
success
:
null
,
fail
:
null
,
complete
:
null
,
});
expect
(
!
allNull
).
assertTrue
();
});
expect
(
!
allNull
).
assertTrue
();
});
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0090
* @tc.name get_status_all_empty
* @tc.desc Battery acquisition kit
*/
it
(
'
get_status_all_empty
'
,
0
,
function
()
{
let
allNull
=
false
;
battery
.
getStatus
();
expect
(
!
allNull
).
assertTrue
();
});
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_0090
* @tc.name get_status_all_empty
* @tc.desc Battery acquisition kit
*/
it
(
'
get_status_all_empty
'
,
0
,
function
()
{
let
allNull
=
false
;
battery
.
getStatus
();
expect
(
!
allNull
).
assertTrue
();
});
})
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录