Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
707d9743
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看板
未验证
提交
707d9743
编写于
9月 01, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 01, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5325 hiappeventjs新增用例,hiappventsub修改用例
Merge pull request !5325 from chenxuihui/master
上级
98adf186
1f66a6e9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
58 addition
and
4 deletion
+58
-4
hiviewdfx/hiappeventtest/hiappeventjstest/src/main/js/test/HiAppEvent.test.js
...test/hiappeventjstest/src/main/js/test/HiAppEvent.test.js
+57
-3
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/test/HiAppEventSub.test.js
...iappeventsubjstest/src/main/js/test/HiAppEventSub.test.js
+1
-1
未找到文件。
hiviewdfx/hiappeventtest/hiappeventjstest/src/main/js/test/HiAppEvent.test.js
浏览文件 @
707d9743
...
...
@@ -538,12 +538,12 @@ describe('HiAppEventApiTest', function () {
console
.
info
(
'
testHiAppEventApi24 end
'
)
})
/**
/**
* @tc.number DFX_DFT_HiviewKit_HiAppEvent_JSNAPI_2500
* @tc.name testHiAppEventApi25
* @tc.desc HiAppEvent with predefined event and param.
*/
it
(
'
testHiAppEventApi25
'
,
3
,
async
function
(
done
)
{
it
(
'
testHiAppEventApi25
'
,
3
,
async
function
(
done
)
{
console
.
info
(
'
testHiAppEventApi25 start
'
)
HiAppEvent
.
write
(
HiAppEvent
.
Event
.
USER_LOGIN
,
HiAppEvent
.
EventType
.
BEHAVIOR
,
{[
HiAppEvent
.
Param
.
USER_ID
]:
'
userlogin
'
,
[
HiAppEvent
.
Param
.
DISTRIBUTED_SERVICE_NAME
]:
'
HiAppEvent
'
,
...
...
@@ -578,5 +578,59 @@ describe('HiAppEventApiTest', function () {
});
console
.
info
(
'
testHiAppEventApi25 end
'
)
})
/**
* @tc.number DFX_DFT_HiviewKit_HiAppEvent_JSNAPI_2600
* @tc.name testHiAppEventApi26
* @tc.desc HiAppEvent write by Promise.
*/
it
(
'
testHiAppEventApi26
'
,
2
,
async
function
(
done
)
{
console
.
info
(
'
testHiAppEventApi26 start
'
)
HiAppEvent
.
write
({
domain
:
"
test_domain
"
,
name
:
"
write
"
,
eventType
:
HiAppEvent
.
EventType
.
FAULT
,
params
:
{
"
key_int
"
:
100
,
"
key_string
"
:
"
demo
"
,
"
key_bool
"
:
true
,
"
key_float
"
:
1.1
,
"
key_array_int
"
:
[
1
,
2
,
3
],
"
key_array_float
"
:
[
1.1
,
2.2
,
3.3
],
"
key_array_str
"
:
[
"
a
"
,
"
b
"
,
"
c
"
],
"
key_array_bool
"
:
[
true
,
false
],
"
key_array_int2
"
:
[
1
,
2
,
3
],
"
key_arr_float2
"
:
[
1.1
,
2.2
,
3.3
],
"
key_arr_str2
"
:
[
"
a
"
,
"
b
"
,
"
c
"
],
"
key_array_bool2
"
:
[
true
,
false
]
}
}).
then
((
value
)
=>
{
console
.
log
(
`success to write event:
${
value
}
`
);
done
();
}).
catch
((
err
)
=>
{
console
.
error
(
`failed to write event because
${
err
.
code
}
`
);
});
console
.
info
(
'
testHiAppEventApi26 end
'
)
})
/**
* @tc.number DFX_DFT_HiviewKit_HiAppEvent_JSNAPI_2700
* @tc.name testHiAppEventApi27
* @tc.desc HiAppEvent write by callback.
*/
it
(
'
testHiAppEventApi27
'
,
2
,
async
function
(
done
)
{
console
.
info
(
'
testHiAppEventApi27 start
'
)
HiAppEvent
.
write
({
domain
:
"
test_domain
"
,
name
:
"
test_event
"
,
eventType
:
HiAppEvent
.
EventType
.
FAULT
,
params
:
{
"
key_int
"
:
100
,
"
key_string
"
:
"
demo
"
,
"
key_bool
"
:
true
,
"
key_float
"
:
1.1
,
"
key_array_int
"
:
[
1
,
2
,
3
],
"
key_array_float
"
:
[
1.1
,
2.2
,
3.3
],
"
key_array_str
"
:
[
"
a
"
,
"
b
"
,
"
c
"
],
"
key_array_bool
"
:
[
true
,
false
],
"
key_array_int2
"
:
[
1
,
2
,
3
],
"
key_arr_float2
"
:
[
1.1
,
2.2
,
3.3
],
"
key_arr_str2
"
:
[
"
a
"
,
"
b
"
,
"
c
"
],
"
key_array_bool2
"
:
[
true
,
false
]
}
},
(
err
,
value
)
=>
{
if
(
err
)
{
console
.
error
(
`failed to write event because
${
err
.
code
}
`
);
done
();
}
console
.
log
(
`success to write event:
${
value
}
`
)
done
();
});
console
.
info
(
'
testHiAppEventApi27 end
'
)
})
})
}
}
\ No newline at end of file
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/test/HiAppEventSub.test.js
浏览文件 @
707d9743
...
...
@@ -2003,7 +2003,7 @@ describe('HiAppEventSubTest', function () {
* @tc.name 验证清理接口功能
* @tc.desc HiAppEvent write interface test.
*/
it
(
'
HiAppEventSub27
'
,
3
,
async
function
()
{
it
(
'
HiAppEventSub27
'
,
3
,
function
()
{
console
.
info
(
'
testHiAppEventSub27 start
'
)
HiAppEvent
.
clearData
()
expect
(
true
).
assertTrue
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录