提交 ac77e86c 编写于 作者: C chensi10

updata test code

Signed-off-by: Nchensi10 <chen.s@neusoft.com>
上级 146db84d
# 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("//build/config/ohos/rules.gni")
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("AnsNotificationTestCancel") {
test_hap_name = "AnsNotificationTestCancel"
hap_source_path = "hap/ans_signed.hap"
}
{
"app": {
"bundleName": "com.example.cancelPublish",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.myapplication",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.myapplication.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
import file from '@system.file'
import app from '@system.app'
import device from '@system.device'
import router from '@system.router'
import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
const reportExtend = new ReportExtend(file)
// const instrumentLog = new InstrumentLog({
// 'id': 'report'
// })
core.addService('expect', expectExtend)
core.addService('report', reportExtend)
// core.addService('report', instrumentLog)
core.init()
// core.subscribeEvent('spec', instrumentLog)
// core.subscribeEvent('suite', instrumentLog)
// core.subscribeEvent('task', instrumentLog)
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
}
/*
* 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 notify from '@ohos.notification'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('AnsNotificationTestCancel', function () {
console.info("===========AnsNotificationTestCancel start====================>");
function publishCallback_0100_1(err) {
console.info("==========================>publishCallback_0100_1 err=======================>" + JSON.stringify(err));
}
function publishCallback_0100_2(err) {
console.info("==========================>publishCallback_0100_2 err=======================>" + JSON.stringify(err));
}
function cancelAllCallBack_0100(err, data){
console.info("==========================>cancelAllCallBack_0100 start=======================>");
console.info("================>cancelAllCallBack_0100 err : =======================>" + JSON.stringify(err));
console.info("==========================>cancelAllCallBack_0100 end=======================>");
}
/*
* @tc.number: ANS_Cancel_0100
* @tc.name: cancelAll(callback: AsyncCallback<void>): void
* @tc.desc: Verify that the application successfully cancels all its published notifications by calling the cancelAll(callback: AsyncCallback<void>) interface
*/
it('ANS_Cancel_0100', 0, async function (done) {
console.info("===============ANS_Cancel_0100 start==========================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
id: 1,
slotType : notify.SlotType.OTHER_TYPES,
isOngoing : true,
isUnremovable : false,
deliveryTime : 1624950453,
tapDismissed : true,
autoDeletedTime: 1625036817,
color: 2,
colorEnabled: true,
isAlertOnce: true,
isStopwatch: true,
isCountDown: true,
progressValue: 12,
progressMaxValue: 100,
isIndeterminate: true,
statusBarText: "statusBarText",
isFloatingIcon : true,
label: "0100_1",
badgeIconStyle: 1,
showDeliveryTime: true,
}
var notificationRequest1 = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
id: 1,
slotType : notify.SlotType.OTHER_TYPES,
isOngoing : true,
isUnremovable : false,
deliveryTime : 1624950453,
tapDismissed : true,
autoDeletedTime: 1625036817,
color: 2,
colorEnabled: true,
isAlertOnce: true,
isStopwatch: true,
isCountDown: true,
progressValue: 12,
progressMaxValue: 100,
isIndeterminate: true,
statusBarText: "statusBarText",
isFloatingIcon : true,
label: "0100_2",
badgeIconStyle: 1,
showDeliveryTime: true,
}
await notify.publish(notificationRequest, publishCallback_0100_1);
console.info("===============ANS_Cancel_0100 publish1 start==========================>");
await notify.publish(notificationRequest1, publishCallback_0100_2);
console.info("===============ANS_Cancel_0100 publish2 start==========================>");
await notify.cancelAll(cancelAllCallBack_0100);
console.info("===============ANS_Cancel_0100 cancelAll start==========================>");
done();
})
/*
* @tc.number: ANS_Cancel_0200
* @tc.name: cancelAll(): Promise<void>
* @tc.desc: Verify that the application successfully cancels all its published notifications by calling the cancelAll(): Promise<void> interface
*/
it('ANS_Cancel_0200', 0, async function (done) {
console.info("===============ANS_Cancel_0200 start==========================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
id: 1,
slotType : notify.SlotType.OTHER_TYPES,
isOngoing : true,
isUnremovable : false,
deliveryTime : 1624950453,
tapDismissed : true,
autoDeletedTime: 1625036817,
color: 2,
colorEnabled: true,
isAlertOnce: true,
isStopwatch: true,
isCountDown: true,
progressValue: 12,
progressMaxValue: 100,
isIndeterminate: true,
statusBarText: "statusBarText",
isFloatingIcon : true,
label: "0100_1",
badgeIconStyle: 1,
showDeliveryTime: true,
}
var notificationRequest1 = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
id: 1,
slotType : notify.SlotType.OTHER_TYPES,
isOngoing : true,
isUnremovable : false,
deliveryTime : 1624950453,
tapDismissed : true,
autoDeletedTime: 1625036817,
color: 2,
colorEnabled: true,
isAlertOnce: true,
isStopwatch: true,
isCountDown: true,
progressValue: 12,
progressMaxValue: 100,
isIndeterminate: true,
statusBarText: "statusBarText",
isFloatingIcon : true,
label: "0100_2",
badgeIconStyle: 1,
showDeliveryTime: true,
}
await notify.publish(notificationRequest).then(() => {
console.info("================>publish_promise_0200 notificationRequest=======================>");
});
await notify.publish(notificationRequest1).then(() => {
console.info("================>publish_promise_0200 notificationRequest1=======================>");
});
await notify.cancelAll().then((err,data) => {
console.info("================>cancelAll_promise_0200 start=======================>");
console.info("================>cancelAll_promise_0200 data: =======================>" + JSON.stringify(data));
console.info("================>cancelAll_promise_0200 err: =======================>" + JSON.stringify(err));
console.info("================>cancelAll_promise_0200 end=======================>");
});
done();
})
function cancelAllCallBack_0300(err){
console.info("==========================>cancelAllCallBack_0300 start=======================>");
console.info("================>cancelAllCallBack_0300 err : =======================>" + JSON.stringify(err));
console.info("==========================>cancelAllCallBack_0300 end=======================>");
}
/*
* @tc.number: ANS_Cancel_0300
* @tc.name: cancelAll(callback: AsyncCallback<void>): void
* @tc.desc: Verify that when no notification is published, call the cancelAll(callback: AsyncCallback<void>): void interface to delete the notification information
*/
it('ANS_Cancel_0300', 0, async function (done) {
console.info("===============ANS_Cancel_0300 start==========================>");
await notify.cancelAll(cancelAllCallBack_0300);
console.info("===============ANS_Cancel_0300 cancelAll start==========================>");
done();
})
/*
* @tc.number: ANS_Cancel_0400
* @tc.name: cancelAll(): Promise<void>
* @tc.desc: Verify that when no notification is published, call the cancelAll(): Promise<void> interface to delete the notification information
*/
it('ANS_Cancel_0400', 0, async function (done) {
console.info("===============ANS_Cancel_0400 start==========================>");
await notify.cancelAll().then((err,data) => {
console.info("================>cancelAll_promise_0400 start=======================>");
console.info("================>cancelAll_promise_0400 data: =======================>" + JSON.stringify(data));
console.info("================>cancelAll_promise_0400 err: =======================>" + JSON.stringify(err));
console.info("================>cancelAll_promise_0400 end=======================>");
});
done();
})
function publishCallback_0500(err) {
console.info("==========================>publishCallback_0500 err=======================>" + JSON.stringify(err));
}
function cancelAllCallBack_0500_1(err){
console.info("==========================>cancelAllCallBack_0500_1 start=======================>");
console.info("================>cancelAllCallBack_0500_1 err : =======================>" + JSON.stringify(err));
console.info("==========================>cancelAllCallBack_0500_1 end=======================>");
}
function cancelAllCallBack_0500_2(err){
console.info("==========================>cancelAllCallBack_0500_2 start=======================>");
console.info("================>cancelAllCallBack_0500_2 err : =======================>" + JSON.stringify(err));
console.info("==========================>cancelAllCallBack_0500_2 end=======================>");
}
/*
* @tc.number: ANS_Cancel_0500
* @tc.name: cancelAll(callback: AsyncCallback<void>): void
* @tc.desc: Verify that when the notification information is issued, call the cancelAll(callback: AsyncCallback<void>): void interface twice to delete the notification information.
*/
it('ANS_Cancel_0500', 0, async function (done) {
console.info("===============ANS_Cancel_0500 start==========================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
id: 5,
slotType : notify.SlotType.OTHER_TYPES,
isOngoing : true,
isUnremovable : false,
deliveryTime : 1624950453,
tapDismissed : true,
autoDeletedTime: 1625036817,
color: 2,
colorEnabled: true,
isAlertOnce: true,
isStopwatch: true,
isCountDown: true,
progressValue: 12,
progressMaxValue: 100,
isIndeterminate: true,
statusBarText: "statusBarText",
isFloatingIcon : true,
label: "0500",
badgeIconStyle: 1,
showDeliveryTime: true,
}
await notify.publish(notificationRequest, publishCallback_0500);
console.info("===============ANS_Cancel_0500 publish start==========================>");
await notify.cancelAll(cancelAllCallBack_0500_1);
console.info("===============ANS_Cancel_0500 cancelAll1 start==========================>");
await notify.cancelAll(cancelAllCallBack_0500_2);
console.info("===============ANS_Cancel_0500 cancelAll2 start==========================>");
done();
})
/*
* @tc.number: ANS_Cancel_0600
* @tc.name: cancelAll(): Promise<void>
* @tc.desc: Verify that when the notification information is issued, call the cancelAll(): Promise<void> interface twice to delete the notification information.
*/
it('ANS_Cancel_0600', 0, async function (done) {
console.info("===============ANS_Cancel_0600 start==========================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
id: 6,
slotType : notify.SlotType.OTHER_TYPES,
isOngoing : true,
isUnremovable : false,
deliveryTime : 1624950453,
tapDismissed : true,
autoDeletedTime: 1625036817,
color: 2,
colorEnabled: true,
isAlertOnce: true,
isStopwatch: true,
isCountDown: true,
progressValue: 12,
progressMaxValue: 100,
isIndeterminate: true,
statusBarText: "statusBarText",
isFloatingIcon : true,
label: "0600",
badgeIconStyle: 1,
showDeliveryTime: true,
}
await notify.publish(notificationRequest).then(() => {
console.info("================>publish_promise_0600=======================>");
});
await notify.cancelAll().then((err,data) => {
console.info("================>cancelAll_promise1_0600 start=======================>");
console.info("================>cancelAll_promise1_0600 data: =======================>" + JSON.stringify(data));
console.info("================>cancelAll_promise1_0600 err: =======================>" + JSON.stringify(err));
console.info("================>cancelAll_promise1_0600 end=======================>");
});
await notify.cancelAll().then((err,data) => {
console.info("================>cancelAll_promise2_0600 start=======================>");
console.info("================>cancelAll_promise2_0600 data: =======================>" + JSON.stringify(data));
console.info("================>cancelAll_promise2_0600 err: =======================>" + JSON.stringify(err));
console.info("================>cancelAll_promise2_0600 end=======================>");
});
done();
})
function publishCallback_0700(err) {
console.info("==========================>publishCallback_0700 err=======================>" + JSON.stringify(err));
}
function cancelAllCallBack_0700(err){
console.info("==========================>cancelAllCallBack_0700 start=======================>");
console.info("================>cancelAllCallBack_0700 err : =======================>" + JSON.stringify(err));
console.info("==========================>cancelAllCallBack_0700 end=======================>");
}
/*
* @tc.number: ANS_Cancel_0700
* @tc.name: cancelAll(callback: AsyncCallback<void>): void
* @tc.desc: iVerify that when the attribute isUnremovable of the published notification information is true, call the cancelAll(callback: AsyncCallback<void>): void interface to cancel the notification information
*/
it('ANS_Cancel_0700', 0, async function (done) {
console.info("===============ANS_Cancel_0400 start==========================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
id: 7,
slotType : notify.SlotType.OTHER_TYPES,
isOngoing : true,
isUnremovable : true,
deliveryTime : 1624950453,
tapDismissed : true,
autoDeletedTime: 1625036817,
color: 2,
colorEnabled: true,
isAlertOnce: true,
isStopwatch: true,
isCountDown: true,
progressValue: 12,
progressMaxValue: 100,
isIndeterminate: true,
statusBarText: "statusBarText",
isFloatingIcon : true,
label: "0700",
badgeIconStyle: 1,
showDeliveryTime: true,
}
await notify.publish(notificationRequest, publishCallback_0700);
console.info("===============ANS_Cancel_0700 publish start==========================>");
await notify.cancelAll(cancelAllCallBack_0700);
console.info("===============ANS_Cancel_0700 cancelAll start==========================>");
done();
})
/*
* @tc.number: ANS_Cancel_0800
* @tc.name: cancelAll(): Promise<void>
* @tc.desc: iVerify that when the attribute isUnremovable of the published notification information is true, call the cancelAll(): Promise<void> interface to cancel the notification information
*/
it('ANS_Cancel_0800', 0, async function (done) {
console.info("===============ANS_Cancel_0800 start==========================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
id: 8,
slotType : notify.SlotType.OTHER_TYPES,
isOngoing : true,
isUnremovable : true,
deliveryTime : 1624950453,
tapDismissed : true,
autoDeletedTime: 1625036817,
color: 2,
colorEnabled: true,
isAlertOnce: true,
isStopwatch: true,
isCountDown: true,
progressValue: 12,
progressMaxValue: 100,
isIndeterminate: true,
statusBarText: "statusBarText",
isFloatingIcon : true,
label: "0800",
badgeIconStyle: 1,
showDeliveryTime: true,
}
await notify.publish(notificationRequest).then(() => {
console.info("================>publish_promise_0800 =======================>");
});
await notify.cancelAll().then((err,data) => {
console.info("================>cancelAll_promise_0800 start=======================>");
console.info("================>cancelAll_promise_0800 data: =======================>" + JSON.stringify(data));
console.info("================>cancelAll_promise_0800 err: =======================>" + JSON.stringify(err));
console.info("================>cancelAll_promise_0800 end=======================>");
});
done();
})
function publishCallback_0900_1(err) {
console.info("==========================>publishCallback_0900_1 err=======================>" + JSON.stringify(err));
}
function cancelAllCallBack_0900_1(err){
console.info("==========================>cancelAllCallBack_0900_1 start=======================>");
console.info("================>cancelAllCallBack_0900_1 err : =======================>" + JSON.stringify(err));
console.info("==========================>cancelAllCallBack_0900_1 end=======================>");
}
function publishCallback_0900_2(err) {
console.info("==========================>publishCallback_0900_2 err=======================>" + JSON.stringify(err));
}
function cancelAllCallBack_0900_2(err){
console.info("==========================>cancelAllCallBack_0900_2 start=======================>");
console.info("================>cancelAllCallBack_0900_2 err : =======================>" + JSON.stringify(err));
console.info("==========================>cancelAllCallBack_0900_2 end=======================>");
}
/*
* @tc.number: ANS_Cancel_0900
* @tc.name: cancelAll(callback: AsyncCallback<void>): void
* @tc.desc: Verification: cancel all notification information after publishing for two consecutive times
*/
it('ANS_Cancel_0900', 0, async function (done) {
console.info("===============ANS_Cancel_0900 start==========================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
id: 9,
slotType : notify.SlotType.OTHER_TYPES,
isOngoing : true,
isUnremovable : false,
deliveryTime : 1624950453,
tapDismissed : true,
autoDeletedTime: 1625036817,
color: 2,
colorEnabled: true,
isAlertOnce: true,
isStopwatch: true,
isCountDown: true,
progressValue: 12,
progressMaxValue: 100,
isIndeterminate: true,
statusBarText: "statusBarText",
isFloatingIcon : true,
label: "0900",
badgeIconStyle: 1,
showDeliveryTime: true,
}
await notify.publish(notificationRequest, publishCallback_0900_1);
console.info("===============ANS_Cancel_0900 publishCallback_0900_1 start==========================>");
await notify.cancelAll(cancelAllCallBack_0900_1);
console.info("===============ANS_Cancel_0900 cancelAll1 start==========================>");
await notify.publish(notificationRequest, publishCallback_0900_2);
console.info("===============ANS_Cancel_0900 publishCallback_0900_1 start==========================>");
await notify.cancelAll(cancelAllCallBack_0900_2);
console.info("===============ANS_Cancel_0900 cancelAll2 start==========================>");
done();
})
/*
* @tc.number: ANS_Cancel_1000
* @tc.name: cancelAll(callback: AsyncCallback<void>): void
* @tc.desc: Verification: cancel all notification information after publishing for two consecutive times
*/
it('ANS_Cancel_1000', 0, async function (done) {
console.info("===============ANS_Cancel_1000 start==========================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
id: 10,
slotType : notify.SlotType.OTHER_TYPES,
isOngoing : true,
isUnremovable : false,
deliveryTime : 1624950453,
tapDismissed : true,
autoDeletedTime: 1625036817,
color: 2,
colorEnabled: true,
isAlertOnce: true,
isStopwatch: true,
isCountDown: true,
progressValue: 12,
progressMaxValue: 100,
isIndeterminate: true,
statusBarText: "statusBarText",
isFloatingIcon : true,
label: "1000",
badgeIconStyle: 1,
showDeliveryTime: true,
}
await notify.publish(notificationRequest).then(() => {
console.info("================>publish1_promise_1000=======================>");
});
await notify.cancelAll().then((err,data) => {
console.info("================>cancelAll1_promise_1000 start=======================>");
console.info("================>cancelAll1_promise_1000 data: =======================>" + JSON.stringify(data));
console.info("================>cancelAll1_promise_1000 err: =======================>" + JSON.stringify(err));
console.info("================>cancelAll1_promise_1000 end=======================>");
});
await notify.publish(notificationRequest).then(() => {
console.info("================>publish1_promise2_1000=======================>");
});
await notify.cancelAll().then((err,data) => {
console.info("================>cancelAll2_promise_1000 start=======================>");
console.info("================>cancelAll2_promise_1000 data: =======================>" + JSON.stringify(data));
console.info("================>cancelAll2_promise_1000 err: =======================>" + JSON.stringify(err));
console.info("================>cancelAll2_promise_1000 end=======================>");
});
done();
})
})
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "MyApplication"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.neu.contentType",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 5,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.test",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.test.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"isVisible": "true",
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
//import device from '@system.device';
//import {Core} from 'deccjsunit/lite'
//const core = Core.getInstance()
//core.init()
//require('../../../test/List.test.js')
//core.execute()
//
//export default {
// data: {
// title: "Test"
// },
// onInit() {
// this.title = this.$t('strings.world');
// }
//}
import file from '@system.file'
import app from '@system.app'
import device from '@system.device'
import router from '@system.router'
import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
const reportExtend = new ReportExtend(file)
// const instrumentLog = new InstrumentLog({
// 'id': 'report'
// })
core.addService('expect', expectExtend)
core.addService('report', reportExtend)
// core.addService('report', instrumentLog)
core.init()
// core.subscribeEvent('spec', instrumentLog)
// core.subscribeEvent('suite', instrumentLog)
// core.subscribeEvent('task', instrumentLog)
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
import notification from '@ohos.notification'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('ActsNotificationTest', function () {
function publishMULTILINEContentCallback001(error){
console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0100 asyncCallback'+JSON.stringify(error.code))
}
function publishMULTILINEContentCallback002(error){
console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0200 asyncCallback'+JSON.stringify(error.code))
}
function publishMULTILINEContentCallback003(error){
console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0300 asyncCallback'+JSON.stringify(error.code))
}
function publishLONGContentCallback001(error){
console.log('ActsNotificationTest ACTS_PublishLONGContent_0100 asyncCallback'+JSON.stringify(error.code))
}
function publishLONGContentCallback002(error){
console.log('ActsNotificationTest ACTS_PublishLONGContent_0200 asyncCallback'+JSON.stringify(error.code))
}
function publishLONGContentCallback003(error){
console.log('ActsNotificationTest ACTS_PublishLONGContent_0300 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotTypeContentCallback001(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0100 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotTypeContentCallback002(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0200 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotTypeContentCallback003(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0300 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotTypeContentCallback004(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0400 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotOtherCallback001(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0100 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotOtherCallback002(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0200 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotOtherCallback003(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0300 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotOtherCallback004(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0400 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotServiceCallback001(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0100 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotServiceCallback002(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0200 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotServiceCallback003(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0300 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotServiceCallback004(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotSocialCallback001(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotSocialCallback002(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotSocialCallback003(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code))
}
function publishSlotSocialCallback004(error){
console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code))
}
/*应用侧发布本地多行类型通知*/
it('ACTS_PublishMULTILINEContent_0100', 0,async function (done) {
try {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE,
multiLine: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText",
briefText: "briefText",
longTitle: "longTitle",
lines: ["123", "234", "345", "456"]
},
}
}, publishMULTILINEContentCallback001);
}catch(error){
console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0100 asyncCallback'+JSON.stringify(error.code))}
console.log("============ACTS_PublishMULTILINEContent_0100 finished============")
done();
})
/*应用侧发布本地多行类型通知,不设置contentType*/
it('ACTS_PublishMULTILINEContent_0200', 0,async function (done) {
try {
var notificationInfo = {
Id: 1,
content: {
// contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE,
multiLine: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText",
briefText: "briefText",
longTitle: "longTitle",
lines: ["123", "234", "345", "456"]
},
}
}
}catch(err){
console.log('ActsNotificationTest ACTS_PublishMULTILINEContent11111111'+err)
}
try{
console.log('ActsNotificationTest ACTS_PublishMULTILINEContent222222222222')
await notification.publish(notificationInfo,publishMULTILINEContentCallback002);
}catch(error){
console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0200 asyncCallback'+error)
}
console.log("============ACTS_PublishMULTILINEContent_0200 finished============")
done();
})
/*应用侧发布本地多行类型通知,将contentType设置为其他类型*/
it('ACTS_PublishMULTILINEContent_0300', 0,async function (done) {
try {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_PICTURE,
multiLine: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText",
briefText: "briefText",
longTitle: "longTitle",
lines: ["123", "234", "345", "456"]
},
}
}, publishMULTILINEContentCallback003);
}catch(error){
console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0300 asyncCallback'+JSON.stringify(error.code))
}
console.log("============ACTS_PublishMULTILINEContent_0300 finished============")
done();
})
/*应用侧发布本地多行类型通知--promise*/
it('ACTS_PublishMULTILINEContent_0400', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE,
multiLine: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText",
briefText:"briefText",
longTitle:"longTitle",
lines:["123","234","345","456"]
},
}
}).then(console.log("============ACTS_PublishMULTILINEContent_0400 finished============"))
done();
})
/*应用侧发布本地多行类型通知,不设置contentType--promise*/
it('ACTS_PublishMULTILINEContent_0500', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
// contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE,
multiLine: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText",
briefText:"briefText",
longTitle:"longTitle",
lines:["123","234","345","456"]
},
}
}).then(console.log("============ACTS_PublishMULTILINEContent_0500 finished============"))
done();
})
/*应用侧发布本地多行类型通知,将contentType设置为其他类型*/
it('ACTS_PublishMULTILINEContent_0600', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_PICTURE,
multiLine: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText",
briefText:"briefText",
longTitle:"longTitle",
lines:["123","234","345","456"]
},
}
}).then(console.log("============ACTS_PublishMULTILINEContent_0300 finished============"))
done();
})
/*应用侧发布本地长文本通知*/
it('ACTS_PublishLONGContent_0100', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT,
longText: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText",
longText:"longText",
briefText:"briefText",
expandedTitle:"expandedTitle"
}}
},publishLONGContentCallback001);
console.log("============ACTS_PublishLONGContent_0100 finished============")
done();
})
/*应用侧发布本地长文本通知,不设置contentType*/
it('ACTS_PublishLONGContent_0200', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
// contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT,
longText: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText",
longText:"longText",
briefText:"briefText",
expandedTitle:"expandedTitle"
}}
},publishLONGContentCallback002);
console.log("============ACTS_PublishLONGContent_0200 finished============")
done();
})
/*应用侧发布本地长文本通知,将contentType设置为其他类型*/
it('ACTS_PublishLONGContent_0300', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_MEDIA,
longText: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText",
longText:"longText",
briefText:"briefText",
expandedTitle:"expandedTitle"
}}
},publishLONGContentCallback003);
console.log("============ACTS_PublishLONGContent_0300 finished============")
done();
})
/*应用侧发布本地长文本通知——promise*/
it('ACTS_PublishLONGContent_0400', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT,
longText: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText",
longText:"longText",
briefText:"briefText",
expandedTitle:"expandedTitle"
}}
}).then(console.log("============ACTS_PublishLONGContent_0400 finished============"))
done();
})
/*应用侧发布本地长文本通知,不设置contentType*/
it('ACTS_PublishLONGContent_0500', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
// contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT,
longText: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText",
longText:"longText",
briefText:"briefText",
expandedTitle:"expandedTitle"
}}
}).then(console.log("============ACTS_PublishLONGContent_0500 finished============"))
done();
})
/*应用侧发布本地长文本通知,将contentType设置为其他类型--promise*/
it('ACTS_PublishLONGContent_0600', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_MEDIA,
longText: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText",
longText:"longText",
briefText:"briefText",
expandedTitle:"expandedTitle"
}}
}).then(console.log("============ACTS_PublishLONGContent_0600 finished============"))
done();
})
/*应用侧发布本地内容资讯类型的普通文本通知*/
it('ACTS_Publish_SlotTypeContent_0100', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
}
},
slotType:notification.SlotType.CONTENT_INFORMATION
},publishSlotTypeContentCallback001);
console.log("============ACTS_Publish_SlotTypeContent_0100 finished============")
done();
})
/*应用侧发布本地内容资讯类型的普通文本通知*/
it('ACTS_Publish_SlotTypeContent_0200', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
// contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
}
},
slotType:notification.SlotType.CONTENT_INFORMATION
},publishSlotTypeContentCallback002);
console.log("============ACTS_Publish_SlotTypeContent_0200 finished============")
done();
})
/*应用侧发布本地内容资讯类型的普通文本通知*/
it('ACTS_Publish_SlotTypeContent_0300', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
}
},
// slotType:notification.SlotType.CONTENT_INFORMATION
},publishSlotTypeContentCallback003);
console.log("============ACTS_Publish_SlotTypeContent_0300 finished============")
done();
})
/*应用侧发布本地内容资讯类型的普通文本通知*/
it('ACTS_Publish_SlotTypeContent_0400', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
}
},
slotType:notification.SlotType.CONTENT_INFORMATION
},publishSlotTypeContentCallback004);
console.log("============ACTS_Publish_SlotTypeContent_0400 finished============")
done();
})
/*应用侧发布本地内容资讯类型的普通文本通知——promise*/
it('ACTS_Publish_SlotTypeContent_0500', 0,async function (done) {
notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
}
},
slotType:notification.SlotType.CONTENT_INFORMATION
}).then( console.log("============ACTS_Publish_SlotTypeContent_0500 finished============"))
done();
})
/*应用侧发布本地内容资讯类型的普通文本通知——promise*/
it('ACTS_Publish_SlotTypeContent_0600', 0,async function (done) {
notification.publish({
Id: 1,
content: {
// contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
}
},
slotType:notification.SlotType.CONTENT_INFORMATION
}).then(console.log("============ACTS_Publish_SlotTypeContent_0600 finished============"))
done();
})
/*应用侧发布本地内容资讯类型的普通文本通知——promise*/
it('ACTS_Publish_SlotTypeContent_0700', 0,async function (done) {
notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
}
},
// slotType:notification.SlotType.CONTENT_INFORMATION
}).then(console.log("============ACTS_Publish_SlotTypeContent_0700 finished============"))
done();
})
/*应用侧发布本地内容资讯类型的普通文本通知——promise*/
it('ACTS_Publish_SlotTypeContent_0800', 0,async function (done) {
notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
}
},
slotType:notification.SlotType.CONTENT_INFORMATION
}).then(console.log("============ACTS_Publish_SlotTypeContent_0800 finished============"))
done();
})
/*应用侧发布本地其他类型的普通文本通知*/
it('ACTS_PublishSlotTypeOther_0100', 0,async function (done) {
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
slotType:notification.SlotType.OTHER_TYPES
}
},publishSlotOtherCallback001);
console.log("============ACTS_PublishSlotTypeOther_0100 finished============")
done();
})
/*应用侧发布本地其他类型的普通文本通知*/
it('ACTS_PublishSlotTypeOther_0200', 0,async function (done) {
await notification.publish({
content: {
// contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
slotType:notification.SlotType.OTHER_TYPES
}
},publishSlotOtherCallback002);
console.log("============ACTS_PublishSlotTypeOther_0200 finished============")
done();
})
/*应用侧发布本地其他类型的普通文本通知*/
it('ACTS_PublishSlotTypeOther_0300', 0,async function (done) {
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
// slotType:notification.SlotType.OTHER_TYPES
}
},publishSlotOtherCallback003);
console.log("============ACTS_PublishSlotTypeOther_0300 finished============")
done();
})
/*应用侧发布本地其他类型的普通文本通知*/
it('ACTS_PublishSlotTypeOther_0400', 0,async function (done) {
await notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
slotType:notification.SlotType.SOCIAL_COMMUNICATION
}
},publishSlotOtherCallback004);
console.log("============ACTS_PublishSlotTypeOther_0400 finished============")
done();
})
/*应用侧发布本地其他类型的普通文本通知——promise*/
it('ACTS_PublishSlotTypeOther_0500', 0,async function (done) {
notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
slotType:notification.SlotType.OTHER_TYPES
}
}).then(console.log("============ACTS_PublishSlotTypeOther_0500 finished============"))
done();
})
/*应用侧发布本地其他类型的普通文本通知——promise*/
it('ACTS_PublishSlotTypeOther_0600', 0,async function (done) {
notification.publish({
content: {
// contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
slotType:notification.SlotType.OTHER_TYPES
}
}).then(console.log("============ACTS_PublishSlotTypeOther_0600 finished============"))
done();
})
/*应用侧发布本地其他类型的普通文本通知———promise*/
it('ACTS_PublishSlotTypeOther_0700', 0,async function (done) {
notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
// slotType:notification.SlotType.OTHER_TYPES
}
}).then(console.log("============ACTS_PublishSlotTypeOther_0700 finished============"))
done();
})
/*应用侧发布本地其他类型的普通文本通知*/
it('ACTS_PublishSlotTypeOther_0800', 0,async function (done) {
notification.publish({
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
slotType:notification.SlotType.SOCIAL_COMMUNICATION
}
}).then(console.log("============ACTS_PublishSlotTypeOther_0800 finished============"))
done();
})
/*应用侧发布本地服务提醒类型的普通文本通知*/
it('ACTS_PublishSlotTypeService_0100', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
slotType:notification.SlotType.SERVICE_INFORMATION
},publishSlotServiceCallback001);
console.log("============ACTS_PublishSlotTypeService_0100 finished============")
done();
})
/*应用侧发布本地服务提醒类型的普通文本通知*/
it('ACTS_PublishSlotTypeService_0200', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
// contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
slotType:notification.SlotType.SERVICE_INFORMATION
},publishSlotServiceCallback002);
console.log("============ACTS_PublishSlotTypeService_0200 finished============")
done();
})
/*应用侧发布本地服务提醒类型的普通文本通知*/
it('ACTS_PublishSlotTypeService_0300', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
// slotType:notification.SlotType.SERVICE_INFORMATION
},publishSlotServiceCallback003);
console.log("============ACTS_PublishSlotTypeService_0300 finished============")
done();
})
/*应用侧发布本地服务提醒类型的普通文本通知*/
it('ACTS_PublishSlotTypeService_0400', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
slotType:notification.SlotType.UNKNOWN_TYPE
},publishSlotServiceCallback004);
console.log("============ACTS_PublishSlotTypeService_0400 finished============")
done();
})
/*应用侧发布本地服务提醒类型的普通文本通知——promise*/
it('ACTS_PublishSlotTypeService_0500', 0,async function (done) {
notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
slotType:notification.SlotType.SERVICE_INFORMATION
}).then(console.log("============ACTS_PublishSlotTypeService_0500 finished============"))
done();
})
/*应用侧发布本地服务提醒类型的普通文本通知——promise*/
it('ACTS_PublishSlotTypeService_0600', 0,async function (done) {
notification.publish({
Id: 1,
content: {
// contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
slotType:notification.SlotType.SERVICE_INFORMATION
}).then(console.log("============ACTS_PublishSlotTypeService_0600 finished============"))
done();
})
/*应用侧发布本地服务提醒类型的普通文本通知——promise*/
it('ACTS_PublishSlotTypeService_0700', 0,async function (done) {
notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
// slotType:notification.SlotType.SERVICE_INFORMATION
}).then(console.log("============ACTS_PublishSlotTypeService_0700 finished============"))
done();
})
/*应用侧发布本地服务提醒类型的普通文本通知——promise*/
it('ACTS_PublishSlotTypeService_0800', 0,async function (done) {
notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
},
slotType:notification.SlotType.UNKNOWN_TYPE
}).then(console.log("============ACTS_PublishSlotTypeService_0800 finished============"))
done();
})
/*应用侧发布本地社交通讯类型的普通文本通知*/
it('ACTS_PublishSlotTypeSocial_0100', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
slotType:notification.SlotType.SOCIAL_COMMUNICATION
}
},publishSlotSocialCallback001);
console.log("============ACTS_PublishSlotTypeSocial_0600 finished============")
done();
})
/*应用侧发布本地社交通讯类型的普通文本通知*/
it('ACTS_PublishSlotTypeSocial_0200', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
// contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
slotType:notification.SlotType.SOCIAL_COMMUNICATION
}
},publishSlotSocialCallback002);
console.log("============ACTS_PublishSlotTypeSocial_0600 finished============")
done();
})
/*应用侧发布本地社交通讯类型的普通文本通知*/
it('ACTS_PublishSlotTypeSocial_0300', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
// slotType:notification.SlotType.SOCIAL_COMMUNICATION
}
},publishSlotSocialCallback003);
console.log("============ACTS_PublishSlotTypeSocial_0300 finished============")
done();
})
/*应用侧发布本地社交通讯类型的普通文本通知*/
it('ACTS_PublishSlotTypeSocial_0400', 0,async function (done) {
await notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
slotType:notification.SlotType.CONTENT_INFORMATION
}
},publishSlotSocialCallback004);
console.log("============ACTS_PublishSlotTypeSocial_0400 finished============")
done();
})
/*应用侧发布本地社交通讯类型的普通文本通知——promise*/
it('ACTS_PublishSlotTypeSocial_0500', 0,async function (done) {
notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
slotType:notification.SlotType.SOCIAL_COMMUNICATION
}
}).then(console.log("============ACTS_PublishSlotTypeSocial_0500 finished============"))
done();
})
/*应用侧发布本地社交通讯类型的普通文本通知——promise*/
it('ACTS_PublishSlotTypeSocial_0600', 0,async function (done) {
notification.publish({
Id: 1,
content: {
// contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
slotType:notification.SlotType.SOCIAL_COMMUNICATION
}
}).then(console.log("============ACTS_PublishSlotTypeSocial_0600 finished============"))
done();
})
/*应用侧发布本地社交通讯类型的普通文本通知——promise*/
it('ACTS_PublishSlotTypeSocial_0700', 0,async function (done) {
notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
// slotType:notification.SlotType.SOCIAL_COMMUNICATION
}
}).then(console.log("============ACTS_PublishSlotTypeSocial_0700 finished============"))
done();
})
/*应用侧发布本地社交通讯类型的普通文本通知——promise*/
it('ACTS_PublishSlotTypeSocial_0800', 0,async function (done) {
notification.publish({
Id: 1,
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: "test_title",
text: "test_text",
additionalText: "test_additionalText"
},
slotType:notification.SlotType.CONTENT_INFORMATION
}
}).then(console.log("============ACTS_PublishSlotTypeSocial_0800 finished============"))
done();
})
})
\ No newline at end of file
//require('./ExampleJsunit.test.js')
require('./ExampleJsunit.test.js')
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "ContentType"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册