Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
02e1bd1f
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看板
未验证
提交
02e1bd1f
编写于
11月 07, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 07, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6369 【XTS】【事件通知子系统】新增ActsNotificationManagerPublishTest_master
Merge pull request !6369 from zhijianwen/master
上级
d2abca39
d2718376
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
404 addition
and
12 deletion
+404
-12
notification/ans_standard/actsNotificationPublishTest/BUILD.gn
...ication/ans_standard/actsNotificationPublishTest/BUILD.gn
+1
-1
notification/ans_standard/actsNotificationPublishTest/src/main/js/MainAbility/app.js
...ctsNotificationPublishTest/src/main/js/MainAbility/app.js
+1
-1
notification/ans_standard/actsNotificationPublishTest/src/main/js/MainAbility/pages/index/index.js
...nPublishTest/src/main/js/MainAbility/pages/index/index.js
+1
-1
notification/ans_standard/actsNotificationPublishTest/src/main/js/test/ActsNotificationManagerPublishTest.js
...st/src/main/js/test/ActsNotificationManagerPublishTest.js
+389
-0
notification/ans_standard/actsNotificationPublishTest/src/main/js/test/ActsNotificationPublishTest.js
...blishTest/src/main/js/test/ActsNotificationPublishTest.js
+8
-8
notification/ans_standard/actsNotificationPublishTest/src/main/js/test/List.test.js
...actsNotificationPublishTest/src/main/js/test/List.test.js
+4
-1
未找到文件。
notification/ans_standard/actsNotificationPublishTest/BUILD.gn
浏览文件 @
02e1bd1f
# Copyright (c) 202
1
Huawei Device Co., Ltd.
# Copyright (c) 202
2
Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
notification/ans_standard/actsNotificationPublishTest/src/main/js/MainAbility/app.js
浏览文件 @
02e1bd1f
/*
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
2
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
notification/ans_standard/actsNotificationPublishTest/src/main/js/MainAbility/pages/index/index.js
浏览文件 @
02e1bd1f
/*
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
2
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
notification/ans_standard/actsNotificationPublishTest/src/main/js/test/ActsNotificationManagerPublishTest.js
0 → 100644
浏览文件 @
02e1bd1f
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
notificationManager
from
'
@ohos.notificationManager
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
image
from
'
@ohos.multimedia.image
'
import
wantAgent
from
'
@ohos.app.ability.wantAgent
'
export
default
function
ActsNotificationManagerPublishTest
()
{
describe
(
'
SUB_NOTIFICATION_ANS_MANAGER_Publish_TEST
'
,
function
()
{
let
TAG
=
'
SUB_NOTIFICATION_ANS_MANAGER_Publish_TEST ===>
'
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_MANAGER_Publish_TEST START
'
)
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0100
* @tc.name : function cancel(id: number, label: string, callback: AsyncCallback<void>): void
* @tc.desc : Cancels a notification with the specified label and ID
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0100 START`
)
let
id
=
1
let
label
=
"
label
"
try
{
await
notificationManager
.
cancel
(
id
,
label
,
(
err
)
=>
{
if
(
err
)
{
console
.
info
(
`
${
TAG
}
cancel AsyncCallback err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
true
).
assertTrue
()
done
()
}
else
{
console
.
info
(
`
${
TAG
}
cancel AsyncCallback success`
)
expect
(
false
).
assertTrue
()
done
()
}
})
}
catch
(
err
)
{
console
.
info
(
`
${
TAG
}
cancel AsyncCallback errCode:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
}
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0100 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0200
* @tc.name : function cancel(id: number, label: string, callback: AsyncCallback<void>): void
* @tc.desc : Cancels a notification with the specified label and ID
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0100 START`
)
let
id
=
1
let
label
=
"
label
"
await
notificationManager
.
cancel
(
id
,
label
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
cancel Promise success`
)
expect
(
false
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
cancel Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
true
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0100 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0300
* @tc.name : function cancel(id: number, callback: AsyncCallback<void>): void
* @tc.desc : Cancels a notification with the specified ID
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0300 START`
)
let
id
=
1
try
{
await
notificationManager
.
cancel
(
id
,
(
err
)
=>
{
if
(
err
)
{
console
.
info
(
`
${
TAG
}
cancel id err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
true
).
assertTrue
()
done
()
}
else
{
console
.
info
(
`
${
TAG
}
cancel id success`
)
expect
(
false
).
assertTrue
()
done
()
}
})
}
catch
(
err
)
{
console
.
info
(
`
${
TAG
}
cancel id errCode:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
}
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0300 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_CANCELAll_TEST_0100
* @tc.name : function cancelAll(callback: AsyncCallback<void>): void
* @tc.desc : Cancels all notifications of the current application
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_CANCELAll_TEST_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCELAll_TEST_0100 START`
)
try
{
await
notificationManager
.
cancelAll
((
err
)
=>
{
if
(
err
)
{
console
.
info
(
`
${
TAG
}
cancelAll AsyncCallback err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
}
else
{
console
.
info
(
`
${
TAG
}
cancelAll AsyncCallback success`
)
expect
(
true
).
assertTrue
()
done
()
}
})
}
catch
(
err
)
{
console
.
info
(
`
${
TAG
}
cancelAll AsyncCallback errCode:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
}
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCELAll_TEST_0100 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_CANCELAll_TEST_0200
* @tc.name : function cancelAll(): Promise<void>
* @tc.desc : Cancels all notifications of the current application
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_CANCELAll_TEST_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCELAll_TEST_0200 START`
)
await
notificationManager
.
cancelAll
().
then
(()
=>
{
console
.
info
(
`
${
TAG
}
cancelAll Promise success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
cancelAll Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCELAll_TEST_0200 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0100
* @tc.name : function cancelGroup(groupName: string, callback: AsyncCallback<void>): void
* @tc.desc : Cancel the notification of a specified group for this application
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0100 START`
)
let
groupName
=
"
groupName
"
try
{
await
notificationManager
.
cancelGroup
(
groupName
,
(
err
)
=>
{
if
(
err
)
{
console
.
info
(
`
${
TAG
}
cancelGroup AsyncCallback err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
}
else
{
console
.
info
(
`
${
TAG
}
cancelGroup AsyncCallback success`
)
expect
(
true
).
assertTrue
()
done
()
}
})
}
catch
(
err
)
{
console
.
info
(
`
${
TAG
}
cancelGroup AsyncCallback errCode:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
}
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0100 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0200
* @tc.name : function cancelGroup(groupName: string): Promise<void>
* @tc.desc : Cancel the notification of a specified group for this application
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0200 START`
)
let
groupName
=
"
groupName
"
await
notificationManager
.
cancelGroup
(
groupName
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
cancelGroup Promise success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
cancelGroup Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0200 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_REQUEST_ENABLE_TEST_0100
* @tc.name : function requestEnableNotification(callback: AsyncCallback<void>): void
* @tc.desc : OperationType.UNKNOWN_TYPE & WantAgentFlags.ONE_TIME_FLAG
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_REQUEST_ENABLE_TEST_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_REQUEST_ENABLE_TEST_0100 START`
)
try
{
await
notificationManager
.
requestEnableNotification
((
err
)
=>
{
if
(
err
)
{
console
.
info
(
`
${
TAG
}
requestEnableNotification AsyncCallback err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
}
else
{
console
.
info
(
`
${
TAG
}
requestEnableNotification AsyncCallback success`
)
expect
(
true
).
assertTrue
()
done
()
}
})
}
catch
(
err
)
{
console
.
info
(
`
${
TAG
}
requestEnableNotification AsyncCallback errCode:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
}
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_REQUEST_ENABLE_TEST_0100 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_REQUEST_ENABLE_TEST_0200
* @tc.name : function requestEnableNotification(): Promise<void>
* @tc.desc : OperationType.UNKNOWN_TYPE & WantAgentFlags.ONE_TIME_FLAG
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_REQUEST_ENABLE_TEST_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_REQUEST_ENABLE_TEST_0200 START`
)
await
notificationManager
.
requestEnableNotification
().
then
(()
=>
{
console
.
info
(
`
${
TAG
}
requestEnableNotification Promise success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
requestEnableNotification Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_REQUEST_ENABLE_TEST_0200 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0100
* @tc.name : function getActiveNotificationCount(callback: AsyncCallback<number>): void
* @tc.desc : Obtains the number of all active notifications
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_ACTIVE_COUNT_TEST_0100 START`
)
try
{
await
notificationManager
.
getActiveNotificationCount
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`
${
TAG
}
getActiveNotificationCount AsyncCallback err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
}
else
{
console
.
info
(
`
${
TAG
}
getActiveNotificationCount AsyncCallback success
${
JSON
.
stringify
(
data
)}
`
)
expect
(
true
).
assertTrue
()
done
()
}
})
}
catch
(
err
)
{
console
.
info
(
`
${
TAG
}
getActiveNotificationCount AsyncCallback errCode:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
}
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0100 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0200
* @tc.name : function getActiveNotificationCount(): Promise<number>
* @tc.desc : Obtains the number of all active notifications
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_ACTIVE_COUNT_TEST_0200 START`
)
await
notificationManager
.
getActiveNotificationCount
().
then
((
data
)
=>
{
console
.
info
(
`
${
TAG
}
getActiveNotificationCount Promise success :
${
JSON
.
stringify
(
data
)}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
getActiveNotificationCount Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0200 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0300
* @tc.name : function getActiveNotifications(callback: AsyncCallback<Array<NotificationRequest>>): void
* @tc.desc : Obtains an array of active notifications
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_ACTIVE_COUNT_TEST_0300 START`
)
try
{
await
notificationManager
.
getActiveNotifications
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`
${
TAG
}
getActiveNotifications AsyncCallback err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
}
else
{
console
.
info
(
`
${
TAG
}
getActiveNotifications AsyncCallback success
${
JSON
.
stringify
(
data
)}
`
)
expect
(
true
).
assertTrue
()
done
()
}
})
}
catch
(
err
)
{
console
.
info
(
`
${
TAG
}
getActiveNotifications AsyncCallback errCode:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
}
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0300 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0400
* @tc.name : function getActiveNotifications(): Promise<Array<NotificationRequest>>
* @tc.desc : Obtains an array of active notifications
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0400 START`
)
await
notificationManager
.
getActiveNotifications
().
then
((
data
)
=>
{
console
.
info
(
`
${
TAG
}
getActiveNotifications Promise success :
${
JSON
.
stringify
(
data
)}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
getActiveNotifications Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0400 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0100
* @tc.name : function isSupportTemplate(templateName: string, callback: AsyncCallback<boolean>): void
* @tc.desc : Obtains whether the template is supported by the system
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0100 START`
)
let
templateName
=
'
test_templateName
'
try
{
await
notificationManager
.
isSupportTemplate
(
templateName
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`
${
TAG
}
isSupportTemplate AsyncCallback err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
}
else
{
console
.
info
(
`
${
TAG
}
isSupportTemplate AsyncCallback success:
${
JSON
.
stringify
(
data
)}
`
)
expect
(
true
).
assertTrue
()
done
()
}
})
}
catch
(
err
)
{
console
.
info
(
`
${
TAG
}
isSupportTemplate AsyncCallback errCode:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
}
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0100 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0200
* @tc.name : function isSupportTemplate(templateName: string): Promise<boolean>
* @tc.desc : Obtains whether the template is supported by the system
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0200 START`
)
let
templateName
=
'
test_templateName
'
await
notificationManager
.
isSupportTemplate
(
templateName
).
then
((
data
)
=>
{
console
.
info
(
`
${
TAG
}
isSupportTemplate Promise success :
${
JSON
.
stringify
(
data
)}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
isSupportTemplate Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0200 END`
)
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_MANAGER_Publish_TEST END
'
)
})
}
notification/ans_standard/actsNotificationPublishTest/src/main/js/test/ActsNotificationPublishTest.js
浏览文件 @
02e1bd1f
/*
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
2
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -155,7 +155,7 @@ export default function ActsNotificationPublishTest() {
* @tc.desc : Publishes a notification
*/
it
(
'
SUB_NOTIFICATION_ANS_PUBLISH_TEST_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_0
1
00 START`
)
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_0
2
00 START`
)
let
notificationRequest
=
{
content
:
{
contentType
:
notification
.
ContentType
.
NOTIFICATION_CONTENT_BASIC_TEXT
,
...
...
@@ -197,7 +197,7 @@ export default function ActsNotificationPublishTest() {
* @tc.desc : Publishes a notification
*/
it
(
'
SUB_NOTIFICATION_ANS_PUBLISH_TEST_0500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_0
1
00 START`
)
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_0
5
00 START`
)
let
notificationRequest
=
{
content
:
{
contentType
:
notification
.
ContentType
.
NOTIFICATION_CONTENT_LONG_TEXT
,
...
...
@@ -249,7 +249,7 @@ export default function ActsNotificationPublishTest() {
* @tc.desc : Publishes a notification
*/
it
(
'
SUB_NOTIFICATION_ANS_PUBLISH_TEST_0600
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_0
1
00 START`
)
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_0
6
00 START`
)
let
notificationRequest
=
{
content
:
{
contentType
:
notification
.
ContentType
.
NOTIFICATION_CONTENT_LONG_TEXT
,
...
...
@@ -299,7 +299,7 @@ export default function ActsNotificationPublishTest() {
* @tc.desc : Publishes a notification
*/
it
(
'
SUB_NOTIFICATION_ANS_PUBLISH_TEST_0700
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_0
1
00 START`
)
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_0
7
00 START`
)
let
notificationRequest
=
{
content
:
{
contentType
:
notification
.
ContentType
.
NOTIFICATION_CONTENT_MULTILINE
,
...
...
@@ -351,7 +351,7 @@ export default function ActsNotificationPublishTest() {
* @tc.desc : Publishes a notification
*/
it
(
'
SUB_NOTIFICATION_ANS_PUBLISH_TEST_0800
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_0
1
00 START`
)
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_0
8
00 START`
)
let
notificationRequest
=
{
content
:
{
contentType
:
notification
.
ContentType
.
NOTIFICATION_CONTENT_MULTILINE
,
...
...
@@ -401,7 +401,7 @@ export default function ActsNotificationPublishTest() {
* @tc.desc : Publishes a notification
*/
it
(
'
SUB_NOTIFICATION_ANS_PUBLISH_TEST_1100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_
0
100 START`
)
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_
1
100 START`
)
let
notificationRequest
=
{
content
:
{
contentType
:
notification
.
ContentType
.
NOTIFICATION_CONTENT_BASIC_TEXT
,
...
...
@@ -456,7 +456,7 @@ export default function ActsNotificationPublishTest() {
* @tc.desc : Publishes a notification
*/
it
(
'
SUB_NOTIFICATION_ANS_PUBLISH_TEST_1200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_
01
00 START`
)
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_
12
00 START`
)
let
notificationRequest
=
{
content
:
{
contentType
:
notification
.
ContentType
.
NOTIFICATION_CONTENT_BASIC_TEXT
,
...
...
notification/ans_standard/actsNotificationPublishTest/src/main/js/test/List.test.js
浏览文件 @
02e1bd1f
/*
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
2
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -13,6 +13,9 @@
* limitations under the License.
*/
import
ActsNotificationPublishTest
from
'
./ActsNotificationPublishTest.js
'
import
ActsNotificationManagerPublishTest
from
'
./ActsNotificationManagerPublishTest.js
'
export
default
function
testsuite
()
{
ActsNotificationPublishTest
()
ActsNotificationManagerPublishTest
()
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录