Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
028f8cf2
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看板
提交
028f8cf2
编写于
8月 20, 2021
作者:
O
openharmony_ci
提交者:
Gitee
8月 20, 2021
浏览文件
操作
浏览文件
下载
差异文件
!457 增加hiappevent的测试用例
Merge pull request !457 from 土行孙/master
上级
16a61478
af3e40d5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
185 addition
and
14 deletion
+185
-14
hiviewdfx/hiappeventtest/hiappeventjstest/project/entry/src/main/js/test/HiAppEvent.test.js
...tjstest/project/entry/src/main/js/test/HiAppEvent.test.js
+185
-14
未找到文件。
hiviewdfx/hiappeventtest/hiappeventjstest/project/entry/src/main/js/test/HiAppEvent.test.js
浏览文件 @
028f8cf2
...
...
@@ -22,7 +22,7 @@ describe('HiAppEventApiTest', function () {
* @tc.name testHiAppEventApi01
* @tc.desc HiAppEvent write interface test.
*/
it
(
'
testHiAppEventApi01
'
,
Function
|
MediumTest
|
Level
1
,
function
()
{
it
(
'
testHiAppEventApi01
'
,
1
,
function
()
{
console
.
info
(
'
testHiAppEventApi01 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_int
"
,
100
,
"
key_float
"
,
1.1
,
"
key_string
"
,
"
demo
"
,
"
key_bool
"
,
true
,
...
...
@@ -49,7 +49,7 @@ describe('HiAppEventApiTest', function () {
* @tc.name testHiAppEventApi02
* @tc.desc HiAppEvent write json interface test.
*/
it
(
'
testHiAppEventApi02
'
,
Function
|
MediumTest
|
Level
1
,
function
()
{
it
(
'
testHiAppEventApi02
'
,
1
,
function
()
{
console
.
info
(
'
testHiAppEventApi02 start
'
)
var
result
=
false
;
HiAppEvent
.
writeJson
(
"
writeJson
"
,
HiAppEvent
.
EventType
.
FAULT
,
{
"
key_int
"
:
100
,
"
key_string
"
:
"
demo
"
,
"
key_bool
"
:
true
,
"
key_float
"
:
1.1
...
...
@@ -74,7 +74,7 @@ describe('HiAppEventApiTest', function () {
* @tc.name testHiAppEventApi03
* @tc.desc HiAppEvent write EventType of STATISTIC.
*/
it
(
'
testHiAppEventApi03
'
,
Function
|
MediumTest
|
Level
2
,
function
()
{
it
(
'
testHiAppEventApi03
'
,
2
,
function
()
{
console
.
info
(
'
testHiAppEventApi03 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
STATISTIC
,
"
key_int
"
,
100
,
"
key_float
"
,
1.1
,
"
key_string
"
,
"
demo
"
,
"
key_bool
"
,
true
,
...
...
@@ -99,7 +99,7 @@ describe('HiAppEventApiTest', function () {
* @tc.name testHiAppEventApi04
* @tc.desc HiAppEvent write EventType of SECURITY.
*/
it
(
'
testHiAppEventApi04
'
,
Function
|
MediumTest
|
Level
2
,
function
()
{
it
(
'
testHiAppEventApi04
'
,
2
,
function
()
{
console
.
info
(
'
testHiAppEventApi04 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
SECURITY
,
"
key_int
"
,
100
,
"
key_float
"
,
1.1
,
"
key_string
"
,
"
demo
"
,
"
key_bool
"
,
true
,
...
...
@@ -124,7 +124,7 @@ describe('HiAppEventApiTest', function () {
* @tc.name testHiAppEventApi05
* @tc.desc HiAppEvent write EventType of BEHAVIOR.
*/
it
(
'
testHiAppEventApi05
'
,
Function
|
MediumTest
|
Level
2
,
function
()
{
it
(
'
testHiAppEventApi05
'
,
2
,
function
()
{
console
.
info
(
'
testHiAppEventApi05 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
BEHAVIOR
,
"
key_int
"
,
100
,
"
key_float
"
,
1.1
,
"
key_string
"
,
"
demo
"
,
"
key_bool
"
,
true
,
...
...
@@ -150,7 +150,7 @@ describe('HiAppEventApiTest', function () {
* @tc.name testHiAppEventApi06
* @tc.desc HiAppEvent write datatype of int.
*/
it
(
'
testHiAppEventApi06
'
,
Function
|
MediumTest
|
Level
2
,
function
()
{
it
(
'
testHiAppEventApi06
'
,
2
,
function
()
{
console
.
info
(
'
testHiAppEventApi06 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_int
"
,
100
,
...
...
@@ -173,7 +173,7 @@ describe('HiAppEventApiTest', function () {
* @tc.name testHiAppEventApi07
* @tc.desc HiAppEvent write datatype of int array.
*/
it
(
'
testHiAppEventApi07
'
,
Function
|
MediumTest
|
Level
2
,
function
()
{
it
(
'
testHiAppEventApi07
'
,
2
,
function
()
{
console
.
info
(
'
testHiAppEventApi07 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_int_array
"
,
[
100
,
200
],
...
...
@@ -196,7 +196,7 @@ describe('HiAppEventApiTest', function () {
* @tc.name testHiAppEventApi08
* @tc.desc HiAppEvent write datatype of float.
*/
it
(
'
testHiAppEventApi08
'
,
Function
|
MediumTest
|
Level
2
,
function
()
{
it
(
'
testHiAppEventApi08
'
,
2
,
function
()
{
console
.
info
(
'
testHiAppEventApi08 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_float
"
,
1.1
,
...
...
@@ -219,7 +219,7 @@ describe('HiAppEventApiTest', function () {
* @tc.name testHiAppEventApi09
* @tc.desc HiAppEvent write datatype of float array.
*/
it
(
'
testHiAppEventApi09
'
,
Function
|
MediumTest
|
Level
3
,
function
()
{
it
(
'
testHiAppEventApi09
'
,
3
,
function
()
{
console
.
info
(
'
testHiAppEventApi09 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_float_array
"
,
[
1.1
,
1.2
],
...
...
@@ -242,7 +242,7 @@ describe('HiAppEventApiTest', function () {
* @tc.name testHiAppEventApi10
* @tc.desc HiAppEvent write datatype of string.
*/
it
(
'
testHiAppEventApi10
'
,
Function
|
MediumTest
|
Level
3
,
function
()
{
it
(
'
testHiAppEventApi10
'
,
3
,
function
()
{
console
.
info
(
'
testHiAppEventApi10 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_string
"
,
"
hello world
"
,
...
...
@@ -265,7 +265,7 @@ describe('HiAppEventApiTest', function () {
* @tc.name testHiAppEventApi11
* @tc.desc HiAppEvent write datatype of string array.
*/
it
(
'
testHiAppEventApi11
'
,
Function
|
MediumTest
|
Level
3
,
function
()
{
it
(
'
testHiAppEventApi11
'
,
3
,
function
()
{
console
.
info
(
'
testHiAppEventApi11 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_string_array
"
,
[
"
hello world
"
,
"
hello world2
"
],
...
...
@@ -288,7 +288,7 @@ describe('HiAppEventApiTest', function () {
* @tc.name testHiAppEventApi12
* @tc.desc HiAppEvent write datatype of bool with true.
*/
it
(
'
testHiAppEventApi12
'
,
Function
|
MediumTest
|
Level
3
,
function
()
{
it
(
'
testHiAppEventApi12
'
,
3
,
function
()
{
console
.
info
(
'
testHiAppEventApi12 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_bool
"
,
true
,
...
...
@@ -311,7 +311,7 @@ describe('HiAppEventApiTest', function () {
* @tc.name testHiAppEventApi13
* @tc.desc HiAppEvent write datatype of bool with false.
*/
it
(
'
testHiAppEventApi13
'
,
Function
|
MediumTest
|
Level
3
,
function
()
{
it
(
'
testHiAppEventApi13
'
,
3
,
function
()
{
console
.
info
(
'
testHiAppEventApi13 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_bool
"
,
false
,
...
...
@@ -334,7 +334,7 @@ describe('HiAppEventApiTest', function () {
* @tc.name testHiAppEventApi14
* @tc.desc HiAppEvent write datatype of bool array.
*/
it
(
'
testHiAppEventApi14
'
,
Function
|
MediumTest
|
Level
3
,
function
()
{
it
(
'
testHiAppEventApi14
'
,
3
,
function
()
{
console
.
info
(
'
testHiAppEventApi14 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_bool_array
"
,
[
false
,
true
],
...
...
@@ -351,4 +351,175 @@ describe('HiAppEventApiTest', function () {
});
console
.
info
(
'
testHiAppEventApi14 end
'
)
})
/**
* @tc.number DFX_DFT_HiviewKit_HiAppEvent_JSNAPI_1500
* @tc.name testHiAppEventApi15
* @tc.desc HiAppEvent write datatype of char.
*/
it
(
'
testHiAppEventApi15
'
,
3
,
function
()
{
console
.
info
(
'
testHiAppEventApi15 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_char
"
,
'
c
'
,
(
err
,
value
)
=>
{
console
.
log
(
`HiAppEvent into json-callback`
);
if
(
err
)
{
console
.
error
(
`HiAppEvent json-callback-error code=
${
err
.
code
}
`
);
result
=
false
;
}
else
{
console
.
log
(
`HiAppEvent json-callback-success value=
${
value
}
`
);
result
=
true
;
}
expect
(
result
).
assertTrue
();
});
console
.
info
(
'
testHiAppEventApi15 end
'
)
})
/**
* @tc.number DFX_DFT_HiviewKit_HiAppEvent_JSNAPI_1600
* @tc.name testHiAppEventApi16
* @tc.desc HiAppEvent write datatype of long.
*/
it
(
'
testHiAppEventApi16
'
,
3
,
function
()
{
console
.
info
(
'
testHiAppEventApi16 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_long
"
,
2147483647
,
(
err
,
value
)
=>
{
console
.
log
(
`HiAppEvent into json-callback`
);
if
(
err
)
{
console
.
error
(
`HiAppEvent json-callback-error code=
${
err
.
code
}
`
);
result
=
false
;
}
else
{
console
.
log
(
`HiAppEvent json-callback-success value=
${
value
}
`
);
result
=
true
;
}
expect
(
result
).
assertTrue
();
});
console
.
info
(
'
testHiAppEventApi16 end
'
)
})
/**
* @tc.number DFX_DFT_HiviewKit_HiAppEvent_JSNAPI_1700
* @tc.name testHiAppEventApi17
* @tc.desc HiAppEvent write datatype of double.
*/
it
(
'
testHiAppEventApi17
'
,
3
,
function
()
{
console
.
info
(
'
testHiAppEventApi17 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_double
"
,
100.123
,
(
err
,
value
)
=>
{
console
.
log
(
`HiAppEvent into json-callback`
);
if
(
err
)
{
console
.
error
(
`HiAppEvent json-callback-error code=
${
err
.
code
}
`
);
result
=
false
;
}
else
{
console
.
log
(
`HiAppEvent json-callback-success value=
${
value
}
`
);
result
=
true
;
}
expect
(
result
).
assertTrue
();
});
console
.
info
(
'
testHiAppEventApi17 end
'
)
})
/**
* @tc.number DFX_DFT_HiviewKit_HiAppEvent_JSNAPI_1800
* @tc.name testHiAppEventApi18
* @tc.desc HiAppEvent write datatype of long.
*/
it
(
'
testHiAppEventApi18
'
,
3
,
function
()
{
console
.
info
(
'
testHiAppEventApi18 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_longlong
"
,
2147483647
,
(
err
,
value
)
=>
{
console
.
log
(
`HiAppEvent into json-callback`
);
if
(
err
)
{
console
.
error
(
`HiAppEvent json-callback-error code=
${
err
.
code
}
`
);
result
=
false
;
}
else
{
console
.
log
(
`HiAppEvent json-callback-success value=
${
value
}
`
);
result
=
true
;
}
expect
(
result
).
assertTrue
();
});
console
.
info
(
'
testHiAppEventApi18 end
'
)
})
/**
* @tc.number DFX_DFT_HiviewKit_HiAppEvent_JSNAPI_1900
* @tc.name testHiAppEventApi19
* @tc.desc HiAppEvent write eventtype of none exists.
*/
it
(
'
testHiAppEventApi19
'
,
3
,
function
()
{
console
.
info
(
'
testHiAppEventApi19 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
"
write
"
,
HiAppEvent
.
EventType
.
BEHAVIOR
+
1
,
"
key_longlong
"
,
2147483647
,
(
err
,
value
)
=>
{
console
.
log
(
`HiAppEvent into json-callback`
);
if
(
err
)
{
console
.
error
(
`HiAppEvent json-callback-error code=
${
err
.
code
}
`
);
result
=
false
;
}
else
{
console
.
log
(
`HiAppEvent json-callback-success value=
${
value
}
`
);
result
=
true
;
}
expect
(
result
).
assertFalse
();
});
console
.
info
(
'
testHiAppEventApi19 end
'
)
})
/**
* @tc.number DFX_DFT_HiviewKit_HiAppEvent_JSNAPI_2000
* @tc.name testHiAppEventApi20
* @tc.desc HiAppEvent write empty eventname .
*/
it
(
'
testHiAppEventApi20
'
,
3
,
function
()
{
console
.
info
(
'
testHiAppEventApi20 start
'
)
var
result
=
false
;
HiAppEvent
.
write
(
""
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_longlong
"
,
2147483647
,
(
err
,
value
)
=>
{
console
.
log
(
`HiAppEvent into json-callback`
);
if
(
err
)
{
console
.
error
(
`HiAppEvent json-callback-error code=
${
err
.
code
}
`
);
result
=
false
;
}
else
{
console
.
log
(
`HiAppEvent json-callback-success value=
${
value
}
`
);
result
=
true
;
}
expect
(
result
).
assertTrue
();
});
console
.
info
(
'
testHiAppEventApi20 end
'
)
})
/**
* @tc.number DFX_DFT_HiviewKit_HiAppEvent_JSNAPI_2100
* @tc.name testHiAppEventApi21
* @tc.desc HiAppEvent write long eventname .
*/
it
(
'
testHiAppEventApi21
'
,
3
,
function
()
{
console
.
info
(
'
testHiAppEventApi21 start
'
)
var
result
=
false
;
var
i
=
0
;
var
strlong
=
""
;
while
(
i
<
1000
)
{
strlong
=
strlong
+
"
eventnamelong
"
;
i
=
i
+
1
;
}
HiAppEvent
.
write
(
strlong
,
HiAppEvent
.
EventType
.
FAULT
,
"
key_longlong
"
,
2147483647
,
(
err
,
value
)
=>
{
console
.
log
(
`HiAppEvent into json-callback`
);
if
(
err
)
{
console
.
error
(
`HiAppEvent json-callback-error code=
${
err
.
code
}
`
);
result
=
false
;
}
else
{
console
.
log
(
`HiAppEvent json-callback-success value=
${
value
}
`
);
result
=
true
;
}
expect
(
result
).
assertTrue
();
});
console
.
info
(
'
testHiAppEventApi21 end
'
)
})
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录