Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d750225c
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看板
未验证
提交
d750225c
编写于
8月 25, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5186 新增d.ts二级目录导出xts用例(monthly)
Merge pull request !5186 from FangJinliang/cherry-pick-1661390805
上级
75dfa44f
e77e5cee
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
885 addition
and
1 deletion
+885
-1
notification/ans_standard/publish_test/BUILD.gn
notification/ans_standard/publish_test/BUILD.gn
+2
-1
notification/ans_standard/publish_test/anssecondarydirectory/AppScope/app.json
...dard/publish_test/anssecondarydirectory/AppScope/app.json
+21
-0
notification/ans_standard/publish_test/anssecondarydirectory/AppScope/resources/base/element/string.json
...darydirectory/AppScope/resources/base/element/string.json
+8
-0
notification/ans_standard/publish_test/anssecondarydirectory/AppScope/resources/base/media/app_icon.png
...ndarydirectory/AppScope/resources/base/media/app_icon.png
+0
-0
notification/ans_standard/publish_test/anssecondarydirectory/BUILD.gn
.../ans_standard/publish_test/anssecondarydirectory/BUILD.gn
+43
-0
notification/ans_standard/publish_test/anssecondarydirectory/Test.json
...ans_standard/publish_test/anssecondarydirectory/Test.json
+23
-0
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/Application/AbilityStage.ts
...ydirectory/entry/src/main/ets/Application/AbilityStage.ts
+23
-0
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/MainAbility/MainAbility.ts
...rydirectory/entry/src/main/ets/MainAbility/MainAbility.ts
+50
-0
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/MainAbility/pages/MainAbility_pages.ets
...ntry/src/main/ets/MainAbility/pages/MainAbility_pages.ets
+47
-0
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...ry/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+78
-0
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/test/List.test.ets
...ssecondarydirectory/entry/src/main/ets/test/List.test.ets
+20
-0
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/test/SecondaryDirectory.test.ets
...ctory/entry/src/main/ets/test/SecondaryDirectory.test.ets
+454
-0
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/module.json
...ish_test/anssecondarydirectory/entry/src/main/module.json
+44
-0
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/element/color.json
...irectory/entry/src/main/resources/base/element/color.json
+8
-0
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/element/string.json
...rectory/entry/src/main/resources/base/element/string.json
+36
-0
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/media/icon.png
...arydirectory/entry/src/main/resources/base/media/icon.png
+0
-0
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/profile/form_config.json
...ry/entry/src/main/resources/base/profile/form_config.json
+23
-0
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/profile/main_pages.json
...ory/entry/src/main/resources/base/profile/main_pages.json
+5
-0
notification/ans_standard/publish_test/anssecondarydirectory/signature/openharmony_sx.p7b
...h_test/anssecondarydirectory/signature/openharmony_sx.p7b
+0
-0
未找到文件。
notification/ans_standard/publish_test/BUILD.gn
浏览文件 @
d750225c
...
...
@@ -32,7 +32,7 @@ group("publish_test") {
"ansactscancelgroup:ActsAnsCancelGroupTest",
"ansactsremovegroup:ActsAnsRemoveGroupTest",
#"donotdisturbmode:ActsAnsDoNotDisturbTest",
#"donotdisturbmode:ActsAnsDoNotDisturbTest",
#"publish:ActsAnsNotificationPublishXts",
"publishsound:ActsAnsPublishSoundTest",
...
...
@@ -40,6 +40,7 @@ group("publish_test") {
#"publishvibra:ActsAnsPublishVibraTest",
#"sub:ActsAnsSubTestXts",
"unsubscribe:ActsAnsUnSubscriberTest",
"anssecondarydirectory:ActsAnsSecondaryDirectoryTest",
"publishremovalwantagent:ActsAnsPublishRemovalWantAgentTest",
"wantagent:wantagent",
]
...
...
notification/ans_standard/publish_test/anssecondarydirectory/AppScope/app.json
0 → 100644
浏览文件 @
d750225c
{
"app"
:
{
"bundleName"
:
"com.example.secondaryDirectory"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
9
,
"targetAPIVersion"
:
9
,
"car"
:
{
"apiCompatibleVersion"
:
9
,
"singleUser"
:
false
}
}
}
notification/ans_standard/publish_test/anssecondarydirectory/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
d750225c
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"LifecycleTest"
}
]
}
\ No newline at end of file
notification/ans_standard/publish_test/anssecondarydirectory/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
d750225c
15.1 KB
notification/ans_standard/publish_test/anssecondarydirectory/BUILD.gn
0 → 100644
浏览文件 @
d750225c
# Copyright (c) 2021 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAnsSecondaryDirectoryTest") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":secondarydirectorytest_js_assets",
":secondarydirectorytest_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAnsSecondaryDirectoryTest"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("secondarydirectorytest_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("secondarydirectorytest_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("secondarydirectorytest_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":secondarydirectorytest_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
notification/ans_standard/publish_test/anssecondarydirectory/Test.json
0 → 100644
浏览文件 @
d750225c
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"180000"
,
"bundle-name"
:
"com.example.secondaryDirectory"
,
"module-name"
:
"phone"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsAnsSecondaryDirectoryTest.hap"
,
"FaSupplement.hap"
,
"StageSupplement.hap"
,
"FormModule.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
d750225c
/*
* Copyright (c) 2021 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
AbilityStage
from
"
@ohos.application.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[Demo] MyAbilityStage onCreate
"
)
globalThis
.
stageContext
=
this
.
context
;
}
}
\ No newline at end of file
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
d750225c
/*
* Copyright (c) 2021 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
Ability
from
'
@ohos.application.Ability
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
applicationContext
=
this
.
context
.
getApplicationContext
();
}
onDestroy
()
{
console
.
log
(
"
[Demo] MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
;
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/MainAbility_pages
"
,
null
)
}
onWindowStageDestroy
()
{
// Main window is destroyed, release UI related resources
console
.
log
(
"
[Demo] MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
[Demo] MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
[Demo] MainAbility onBackground
"
)
}
};
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/MainAbility/pages/MainAbility_pages.ets
0 → 100644
浏览文件 @
d750225c
// @ts-nocheck
/*
* Copyright (c) 2021 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 router from '@ohos.router';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../test/List.test'
@Entry
@Component
struct Index {
@State message: string = 'MainAbility'
aboutToAppear() {
console.info("start run testcase!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
d750225c
/*
* 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
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
"
onAbilityCreateCallback
"
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
"
addAbilityMonitorCallback :
"
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
info
(
"
OpenHarmonyTestRunner OnPrepare
"
)
}
async
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a com.example.secondaryDirectory.MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
\ No newline at end of file
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
d750225c
/*
* Copyright (c) 2021 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 secondaryDirectory from './SecondaryDirectory.test'
export default function List() {
secondaryDirectory()
}
\ No newline at end of file
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/test/SecondaryDirectory.test.ets
0 → 100644
浏览文件 @
d750225c
/*
* 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import notify from '@ohos.notification'
import WantAgent from '@ohos.wantAgent'
var timeout = 1000;
export default function secondaryDirectoryTest() {
describe('secondaryDirectoryTest', function () {
console.info("===========secondaryDirectoryTest start====================>");
/*
* @tc.number: ACTS_SecondaryDirectory_xts_0000
* @tc.name: enableNotification()
* @tc.desc: verify the function of enableNotification
*/
it('ACTS_SecondaryDirectory_xts_0000', 0, async function (done) {
console.info("===ACTS_SecondaryDirectory_xts_0000===begin===>");
let promise = await notify.enableNotification({
bundle:"com.example.secondaryDirectory"
},true)
console.info("===ACTS_SecondaryDirectory_xts_0000===end===>");
done();
})
/*
* @tc.number: ACTS_SecondaryDirectory_xts_0100
* @tc.name: NotificationRequest、NotificationSubscriber、NotificationSubscribeInfo、SubscribeCallbackData
* @tc.desc: use NotificationRequest type
*/
function consumeCallback1(data) {
console.info("===>consumeCallback1 data : ===>" +JSON.stringify(data));
let subscribeCallback: notify.SubscribeCallbackData;
subscribeCallback = data;
let contentType = subscribeCallback.request.content.contentType;
console.info("===>contentType: ===>" + contentType)
expect(contentType).assertEqual(notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT);
}
it('ACTS_SecondaryDirectory_xts_0100', 0, async function (done) {
console.info("===ACTS_SecondaryDirectory_xts_0100===begin===>");
let subscriber: notify.NotificationSubscriber = {
onConsume:consumeCallback1
}
let subscriberInfo: notify.NotificationSubscribeInfo = {
bundleNames: ["com.example.secondaryDirectory"]
}
await notify.subscribe(subscriber, subscriberInfo);
let basicContent: notify.NotificationBasicContent = {
title: "test_title",
text: "test_text",
additionalText: "test_Publish"
}
let notifyContent: notify.NotificationContent = {
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: basicContent
}
let notificationRequest : notify.NotificationRequest = {
content: notifyContent,
id: 1
}
console.info("===ACTS_SecondaryDirectory_xts_0100===publish===>");
await notify.publish(notificationRequest, (err) => {
console.info("===>publish callback===>"+err.code);
expect(err.code).assertEqual(0)
});
console.info("===ACTS_SecondaryDirectory_xts_0100===end===>");
setTimeout((async function(){
notify.unsubscribe(subscriber);
console.info("======ACTS_SecondaryDirectory_xts_0100 setTimeout unsubscribe===>");
done();
}),timeout);
});
/*
* @tc.number: ACTS_SecondaryDirectory_xts_0200
* @tc.name: NotificationLongTextContent
* @tc.desc: use NotificationLongTextContent type
*/
function consumeCallback2(data) {
console.info("===>consumeCallback2 data : ===>" +JSON.stringify(data));
let longContentText: notify.NotificationLongTextContent = data.request.content.longText;
console.info("===>longText: ===>" + JSON.stringify(longContentText))
expect(longContentText.title).assertEqual("test_title");
expect(longContentText.text).assertEqual("test_text");
expect(longContentText.additionalText).assertEqual("test_Publish");
expect(longContentText.longText).assertEqual("longText123456");
expect(longContentText.briefText).assertEqual("briefText123456");
expect(longContentText.expandedTitle).assertEqual("expandedTitle123456");
}
it('ACTS_SecondaryDirectory_xts_0200', 0, async function (done) {
console.info("===ACTS_SecondaryDirectory_xts_0200===begin===>");
let subInfo: notify.NotificationSubscriber = {
onConsume:consumeCallback2
}
await notify.subscribe(subInfo);
let longContentText: notify.NotificationLongTextContent = {
title: "test_title",
text: "test_text",
additionalText: "test_Publish",
longText: "longText123456",
briefText: "briefText123456",
expandedTitle: "expandedTitle123456"
}
let notifyContent: notify.NotificationContent = {
contentType: notify.ContentType.NOTIFICATION_CONTENT_LONG_TEXT,
longText: longContentText
}
let notificationRequest : notify.NotificationRequest = {
content: notifyContent,
id: 2,
slotType: notify.SlotType.SERVICE_INFORMATION,
}
console.info("===ACTS_SecondaryDirectory_xts_0200===publish===>");
await notify.publish(notificationRequest, (err) => {
console.info("===>publish callback===>"+err.code);
expect(err.code).assertEqual(0)
});
console.info("===ACTS_SecondaryDirectory_xts_0200===end===>");
setTimeout((async function(){
notify.unsubscribe(subInfo);
console.info("======ACTS_SecondaryDirectory_xts_0200 setTimeout unsubscribe===>");
done();
}),timeout);
});
/*
* @tc.number: ACTS_SecondaryDirectory_xts_0300
* @tc.name: NotificationBasicContent
* @tc.desc: use NotificationBasicContent type
*/
function consumeCallback3(data) {
console.info("===>consumeCallback3 data : ===>" +JSON.stringify(data));
let basicContentText: notify.NotificationBasicContent = data.request.content.normal;
console.info("===>basicText: ===>" + JSON.stringify(basicContentText))
expect(basicContentText.title).assertEqual("test_title");
expect(basicContentText.text).assertEqual("test_text");
expect(basicContentText.additionalText).assertEqual("test_Publish");
}
it('ACTS_SecondaryDirectory_xts_0300', 0, async function (done) {
console.info("===ACTS_SecondaryDirectory_xts_0300===begin===>");
let subInfo: notify.NotificationSubscriber = {
onConsume:consumeCallback3
}
await notify.subscribe(subInfo);
let basicContent: notify.NotificationBasicContent = {
title: "test_title",
text: "test_text",
additionalText: "test_Publish"
}
let notifyContent: notify.NotificationContent = {
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: basicContent
}
let notificationRequest : notify.NotificationRequest = {
content: notifyContent,
id: 3
}
console.info("===ACTS_SecondaryDirectory_xts_0300===publish===>");
await notify.publish(notificationRequest, (err) => {
console.info("===>publish callback===>"+err.code);
expect(err.code).assertEqual(0)
});
console.info("===ACTS_SecondaryDirectory_xts_0300===end===>");
setTimeout((async function(){
notify.unsubscribe(subInfo);
console.info("======ACTS_SecondaryDirectory_xts_0300 setTimeout unsubscribe===>");
done();
}),timeout);
});
/*
* @tc.number: ACTS_SecondaryDirectory_xts_0400
* @tc.name: NotificationMultiLineContent
* @tc.desc: use NotificationMultiLineContent type
*/
function consumeCallback4(data) {
console.info("===>consumeCallback4 data : ===>" +JSON.stringify(data));
let longContentText: notify.NotificationMultiLineContent = data.request.content.multiLine;
console.info("===>multiLineText: ===>" + JSON.stringify(longContentText))
expect(longContentText.briefText).assertEqual("notificationMultiLineContent_title");
expect(longContentText.longTitle).assertEqual("notificationMultiLineContent_title_12345678999999999");
expect(longContentText.lines[0]).assertEqual("thrive");
expect(longContentText.lines[1]).assertEqual("democracy");
expect(longContentText.lines[2]).assertEqual("civilization");
expect(longContentText.lines[3]).assertEqual("harmonious");
}
it('ACTS_SecondaryDirectory_xts_0400', 0, async function (done) {
console.info("===ACTS_SecondaryDirectory_xts_0400===begin===>");
let subInfo: notify.NotificationSubscriber = {
onConsume:consumeCallback4
}
await notify.subscribe(subInfo);
let multiLineContent: notify.NotificationMultiLineContent = {
title: "test_title",
text: "test_text",
briefText: "notificationMultiLineContent_title",
longTitle: "notificationMultiLineContent_title_12345678999999999",
lines: ["thrive", "democracy", "civilization", "harmonious"]
}
let notifyContent: notify.NotificationContent = {
contentType: notify.ContentType.NOTIFICATION_CONTENT_MULTILINE,
multiLine: multiLineContent
}
let notificationRequest : notify.NotificationRequest = {
content: notifyContent,
id: 4
}
console.info("===ACTS_SecondaryDirectory_xts_0400===publish===>");
await notify.publish(notificationRequest, (err) => {
console.info("===>publish callback===>"+err.code);
expect(err.code).assertEqual(0)
});
console.info("===ACTS_SecondaryDirectory_xts_0400===end===>");
setTimeout((async function(){
notify.unsubscribe(subInfo);
console.info("======ACTS_SecondaryDirectory_xts_0400 setTimeout unsubscribe===>");
done();
}),timeout);
});
/*
* @tc.number: ACTS_SecondaryDirectory_xts_0500
* @tc.name: NotificationActionButton、NotificationUserInput
* @tc.desc: use NotificationActionButton type
*/
function consumeCallback5(data) {
console.info("===>consumeCallback5 data : ===>" +JSON.stringify(data));
let actionButtons = data.request.actionButtons[0]
console.info("===>actionButtons: ===>" + JSON.stringify(actionButtons))
expect(actionButtons.title).assertEqual("buttonA");
expect(actionButtons.userInput.inputKey).assertEqual("test_NotificationUserInput");
WantAgent.getWant(actionButtons.wantAgent).then((data) => {
expect(data[0].action).assertEqual("usual.event.REMOVAL_WANTAGENT");
});
}
it('ACTS_SecondaryDirectory_xts_0500', 0, async function (done) {
console.info("===ACTS_SecondaryDirectory_xts_0500===begin===>");
let subInfo: notify.NotificationSubscriber = {
onConsume:consumeCallback5
}
await notify.subscribe(subInfo);
let agentInfo = {
wants: [
{
bundleName: 'com.example.secondaryDirectory',
abilityName: 'com.example.secondaryDirectory.MainAbility',
action: "usual.event.REMOVAL_WANTAGENT"
}
],
operationType: WantAgent.OperationType.SEND_COMMON_EVENT,
requestCode: 0,
wantAgentFlags:[WantAgent.WantAgentFlags.ONE_TIME_FLAG]
};
let wantAgentData = await WantAgent.getWantAgent(agentInfo);
let basicContent: notify.NotificationBasicContent = {
title: "test_title",
text: "test_text",
additionalText: "test_Publish"
}
let notifyContent: notify.NotificationContent = {
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: basicContent
}
let userInputContent: notify.NotificationUserInput = {
inputKey: 'test_NotificationUserInput',
}
let notificationRequest : notify.NotificationRequest = {
content: notifyContent,
actionButtons: [
{
title:"buttonA",
wantAgent: wantAgentData,
userInput: userInputContent
}
],
id: 5
}
console.info("===ACTS_SecondaryDirectory_xts_0500===publish===>");
await notify.publish(notificationRequest, (err) => {
console.info("===>publish callback===>"+err.code);
expect(err.code).assertEqual(0)
});
console.info("===ACTS_SecondaryDirectory_xts_0500===end===>");
setTimeout((async function(){
notify.unsubscribe(subInfo);
console.info("======ACTS_SecondaryDirectory_xts_0500 setTimeout unsubscribe===>");
done();
}),timeout);
});
/*
* @tc.number: ACTS_SecondaryDirectory_xts_0600
* @tc.name: NotificationTemplate
* @tc.desc: use NotificationTemplate type
*/
function consumeCallback6(data) {
console.info("===>consumeCallback6 data : ===>" +JSON.stringify(data));
let templateContent: notify.NotificationTemplate = data.request.template;
console.info("===>template: ===>" + JSON.stringify(templateContent))
expect(templateContent.name).assertEqual("downloadTemplate");
expect(templateContent.data.title).assertEqual("file");
expect(templateContent.data.fileName).assertEqual("music.mp4");
expect(templateContent.data.progressValue).assertEqual(45);
}
it('ACTS_SecondaryDirectory_xts_0600', 0, async function (done) {
console.info("===ACTS_SecondaryDirectory_xts_0600===begin===>");
let subInfo: notify.NotificationSubscriber = {
onConsume:consumeCallback6
}
await notify.subscribe(subInfo);
let basicContent: notify.NotificationBasicContent = {
title: "test_title",
text: "test_text",
additionalText: "test_Publish"
}
let notifyContent: notify.NotificationContent = {
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: basicContent
}
let notifyTemplate: notify.NotificationTemplate = {
name: 'downloadTemplate',
data: {
title: 'file',
fileName: 'music.mp4',
progressValue: 45
}
}
let notificationRequest : notify.NotificationRequest = {
content: notifyContent,
template: notifyTemplate,
id: 6
}
console.info("===ACTS_SecondaryDirectory_xts_0600===publish===>");
await notify.publish(notificationRequest, (err) => {
console.info("===>publish callback===>"+err.code);
expect(err.code).assertEqual(0)
});
console.info("===ACTS_SecondaryDirectory_xts_0600===end===>");
setTimeout((async function(){
notify.unsubscribe(subInfo);
console.info("======ACTS_SecondaryDirectory_xts_0600 setTimeout unsubscribe===>");
done();
}),timeout);
});
/*
* @tc.number: ACTS_SecondaryDirectory_xts_0700
* @tc.name: DistributedOptions
* @tc.desc: use DistributedOptions type
*/
function consumeCallback7(data) {
console.info("===>consumeCallback7 data : ===>" +JSON.stringify(data));
let options: notify.DistributedOptions = data.request.distributedOption;
console.info("===>longText: ===>" + JSON.stringify(options))
expect(options.isDistributed).assertEqual(false);
expect(options.supportDisplayDevices[0]).assertEqual("0");
expect(options.supportOperateDevices[0]).assertEqual("0");
}
it('ACTS_SecondaryDirectory_xts_0700', 0, async function (done) {
console.info("===ACTS_SecondaryDirectory_xts_0700===begin===>");
let subInfo: notify.NotificationSubscriber = {
onConsume:consumeCallback7
}
await notify.subscribe(subInfo);
let options: notify.DistributedOptions = {
isDistributed: false,
supportDisplayDevices: ["0"],
supportOperateDevices: ["0"]
}
let basicContent: notify.NotificationBasicContent = {
title: "test_title",
text: "test_text",
additionalText: "test_Publish"
}
let notifyContent: notify.NotificationContent = {
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: basicContent
}
let notificationRequest : notify.NotificationRequest = {
content: notifyContent,
distributedOption: options,
id: 7
}
console.info("===ACTS_SecondaryDirectory_xts_0700===publish===>");
await notify.publish(notificationRequest, (err) => {
console.info("===>publish callback===>"+err.code);
expect(err.code).assertEqual(0)
});
console.info("===ACTS_SecondaryDirectory_xts_0700===end===>");
setTimeout((async function(){
notify.unsubscribe(subInfo);
console.info("======ACTS_SecondaryDirectory_xts_0700 setTimeout unsubscribe===>");
done();
}),timeout);
});
}) }
\ No newline at end of file
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/module.json
0 → 100644
浏览文件 @
d750225c
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"phone"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"pages"
:
"$profile:main_pages"
,
"uiSyntax"
:
"ets"
,
"abilities"
:
[
{
"name"
:
"com.example.secondaryDirectory.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"startWindowIcon"
:
"$media:icon"
,
"startWindowBackground"
:
"$color:white"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
]
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.NOTIFICATION_CONTROLLER"
}
]
}
}
\ No newline at end of file
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/element/color.json
0 → 100644
浏览文件 @
d750225c
{
"color"
:
[
{
"name"
:
"white"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
d750225c
{
"string"
:
[
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsLifecycleMultihapTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"entry_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"label"
}
]
}
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
d750225c
15.1 KB
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/profile/form_config.json
0 → 100644
浏览文件 @
d750225c
{
"forms"
:
[
{
"isDefault"
:
true
,
"src"
:
"./js/widget/pages/index/index"
,
"scheduledUpdateTime"
:
"10:30"
,
"defaultDimension"
:
"2*2"
,
"name"
:
"widget"
,
"description"
:
"This is a service widget."
,
"colorMode"
:
"auto"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
},
"formConfigAbility"
:
"ability://xxxxx"
,
"supportDimensions"
:
[
"2*2"
],
"updateEnabled"
:
true
,
"updateDuration"
:
1
}
]
}
\ No newline at end of file
notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
d750225c
{
"src"
:
[
"MainAbility/pages/MainAbility_pages"
]
}
\ No newline at end of file
notification/ans_standard/publish_test/anssecondarydirectory/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
d750225c
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录