提交 e0402820 编写于 作者: Z zhijianwen

showName

Signed-off-by: Nzhijianwen <zhijianwen@huawei.com>
上级 1c13b483
......@@ -16,17 +16,17 @@ import notification from '@system.notification'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
export default function ActsNotificationShowTest() {
describe('SUB_NOTIFICATION_SHOW_TEST', function () {
const TAG = 'SUB_NOTIFICATION_SHOW_TEST ===> '
console.info(TAG + "SUB_NOTIFICATION_SHOW_TEST START")
describe('SUB_NOTIFICATION_ANS_SHOW_TEST', function () {
const TAG = 'SUB_NOTIFICATION_ANS_SHOW_TEST ===> '
console.info(TAG + "SUB_NOTIFICATION_ANS_SHOW_TEST START")
/*
* @tc.number: SUB_NOTIFICATION_SHOW_TEST_0100
* @tc.number: SUB_NOTIFICATION_ANS_SHOW_TEST_0100
* @tc.name: show()
* @tc.desc: verify the function of show
*/
it('SUB_NOTIFICATION_SHOW_TEST_0100', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_SHOW_TEST_0100 START ')
it('SUB_NOTIFICATION_ANS_SHOW_TEST_0100', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_ANS_SHOW_TEST_0100 START ')
let ShowNotificationOptions = {
contentTitle: 'Title1',
contentText: 'This is a notification 001'
......@@ -40,12 +40,12 @@ export default function ActsNotificationShowTest() {
})
/*
* @tc.number: SUB_NOTIFICATION_SHOW_TEST_0200
* @tc.number: SUB_NOTIFICATION_ANS_SHOW_TEST_0200
* @tc.name: show()
* @tc.desc: verify the function of show
*/
it('SUB_NOTIFICATION_SHOW_TEST_0200', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_SHOW_TEST_0200 START ')
it('SUB_NOTIFICATION_ANS_SHOW_TEST_0200', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_ANS_SHOW_TEST_0200 START ')
let ShowNotificationOptions = {
contentTitle: 123,
contentText: 'This is a notification 002'
......@@ -58,12 +58,12 @@ export default function ActsNotificationShowTest() {
})
/*
* @tc.number: SUB_NOTIFICATION_SHOW_TEST_0300
* @tc.number: SUB_NOTIFICATION_ANS_SHOW_TEST_0300
* @tc.name: show()
* @tc.desc: verify the function of show
*/
it('SUB_NOTIFICATION_SHOW_TEST_0300', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_SHOW_TEST_0300 START ')
it('SUB_NOTIFICATION_ANS_SHOW_TEST_0300', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_ANS_SHOW_TEST_0300 START ')
let ShowNotificationOptions = {}
notification.show(ShowNotificationOptions)
expect(ShowNotificationOptions.contentTitle).assertEqual(undefined)
......@@ -71,15 +71,15 @@ export default function ActsNotificationShowTest() {
})
/*
* @tc.number: SUB_NOTIFICATION_SHOW_TEST_0400
* @tc.number: SUB_NOTIFICATION_ANS_SHOW_TEST_0400
* @tc.name: show()
* @tc.desc: verify the function of show
*/
it('SUB_NOTIFICATION_SHOW_TEST_0400', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_SHOW_TEST_0400 START ')
it('SUB_NOTIFICATION_ANS_SHOW_TEST_0400', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_ANS_SHOW_TEST_0400 START ')
let ActionResult = {
bundleName: 'com.example.notification',
abilityName: 'com.example.notification.MainAbility',
bundleName: 'com.example.actsnotificationshow',
abilityName: 'com.example.actsnotificationshow.MainAbility',
uri: '/'
}
let ShowNotificationOptions = {
......@@ -95,22 +95,22 @@ export default function ActsNotificationShowTest() {
console.info(TAG + ' ActionResult uri:' + ShowNotificationOptions.clickAction.uri)
expect(ShowNotificationOptions.contentTitle).assertEqual('Title4')
expect(ShowNotificationOptions.contentText).assertEqual('This is a notification 004')
expect(ShowNotificationOptions.clickAction.bundleName).assertEqual('com.example.notification')
expect(ShowNotificationOptions.clickAction.abilityName).assertEqual('com.example.notification.MainAbility')
expect(ShowNotificationOptions.clickAction.bundleName).assertEqual('com.example.actsnotificationshow')
expect(ShowNotificationOptions.clickAction.abilityName).assertEqual('com.example.actsnotificationshow.MainAbility')
expect(ShowNotificationOptions.clickAction.uri).assertEqual('/')
done()
})
/*
* @tc.number: SUB_NOTIFICATION_SHOW_TEST_0500
* @tc.number: SUB_NOTIFICATION_ANS_SHOW_TEST_0500
* @tc.name: show()
* @tc.desc: verify the function of show
*/
it('SUB_NOTIFICATION_SHOW_TEST_0500', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_SHOW_TEST_0500 START ')
it('SUB_NOTIFICATION_ANS_SHOW_TEST_0500', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_ANS_SHOW_TEST_0500 START ')
let ActionResult = {
bundleName: 'com.example.notification',
abilityName: 'com.example.notification.MainAbility',
bundleName: 'com.example.actsnotificationshow',
abilityName: 'com.example.actsnotificationshow.MainAbility',
uri: 'pages/index/index'
}
let ShowNotificationOptions = {
......@@ -126,22 +126,22 @@ export default function ActsNotificationShowTest() {
console.info(TAG + ' ActionResult uri:' + ShowNotificationOptions.clickAction.uri)
expect(ShowNotificationOptions.contentTitle).assertEqual('Title5')
expect(ShowNotificationOptions.contentText).assertEqual('This is a notification 005')
expect(ShowNotificationOptions.clickAction.bundleName).assertEqual('com.example.notification')
expect(ShowNotificationOptions.clickAction.abilityName).assertEqual('com.example.notification.MainAbility')
expect(ShowNotificationOptions.clickAction.bundleName).assertEqual('com.example.actsnotificationshow')
expect(ShowNotificationOptions.clickAction.abilityName).assertEqual('com.example.actsnotificationshow.MainAbility')
expect(ShowNotificationOptions.clickAction.uri).assertEqual('pages/index/index')
done()
})
/*
* @tc.number: SUB_NOTIFICATION_SHOW_TEST_0600
* @tc.number: SUB_NOTIFICATION_ANS_SHOW_TEST_0600
* @tc.name: show()
* @tc.desc: verify the function of show
*/
it('SUB_NOTIFICATION_SHOW_TEST_0600', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_SHOW_TEST_0600 START ')
it('SUB_NOTIFICATION_ANS_SHOW_TEST_0600', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_ANS_SHOW_TEST_0600 START ')
let ActionResult = {
bundleName: '',
abilityName: 'com.example.notification.MainAbility',
abilityName: 'com.example.actsnotificationshow.MainAbility',
uri: '/',
}
let ShowNotificationOptions = {
......@@ -157,20 +157,20 @@ export default function ActsNotificationShowTest() {
console.info(TAG + ' ActionResult uri:' + ShowNotificationOptions.clickAction.uri)
expect(ShowNotificationOptions.contentTitle).assertEqual('Title6')
expect(ShowNotificationOptions.contentText).assertEqual('This is a notification 006')
expect(ShowNotificationOptions.clickAction.abilityName).assertEqual('com.example.notification.MainAbility')
expect(ShowNotificationOptions.clickAction.abilityName).assertEqual('com.example.actsnotificationshow.MainAbility')
expect(ShowNotificationOptions.clickAction.uri).assertEqual('/')
done()
})
/*
* @tc.number: SUB_NOTIFICATION_SHOW_TEST_0700
* @tc.number: SUB_NOTIFICATION_ANS_SHOW_TEST_0700
* @tc.name: show()
* @tc.desc: verify the function of show
*/
it('SUB_NOTIFICATION_SHOW_TEST_0700', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_SHOW_TEST_0700 START ')
it('SUB_NOTIFICATION_ANS_SHOW_TEST_0700', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_ANS_SHOW_TEST_0700 START ')
let ActionResult = {
bundleName: 'com.example.notification',
bundleName: 'com.example.actsnotificationshow',
abilityName: '',
uri: '/',
}
......@@ -187,21 +187,21 @@ export default function ActsNotificationShowTest() {
console.info(TAG + ' ActionResult uri:' + ShowNotificationOptions.clickAction.uri)
expect(ShowNotificationOptions.contentTitle).assertEqual('Title7')
expect(ShowNotificationOptions.contentText).assertEqual('This is a notification 007')
expect(ShowNotificationOptions.clickAction.bundleName).assertEqual('com.example.notification')
expect(ShowNotificationOptions.clickAction.bundleName).assertEqual('com.example.actsnotificationshow')
expect(ShowNotificationOptions.clickAction.uri).assertEqual('/')
done()
})
/*
* @tc.number: SUB_NOTIFICATION_SHOW_TEST_0800
* @tc.number: SUB_NOTIFICATION_ANS_SHOW_TEST_0800
* @tc.name: show()
* @tc.desc: verify the function of show
*/
it('SUB_NOTIFICATION_SHOW_TEST_0800', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_SHOW_TEST_0800 START ')
it('SUB_NOTIFICATION_ANS_SHOW_TEST_0800', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_ANS_SHOW_TEST_0800 START ')
let ActionResult = {
bundleName: 'com.example.notification',
abilityName: 'com.example.notification.MainAbility',
bundleName: 'com.example.actsnotificationshow',
abilityName: 'com.example.actsnotificationshow.MainAbility',
uri: '',
}
let ShowNotificationOptions = {
......@@ -217,21 +217,21 @@ export default function ActsNotificationShowTest() {
console.info(TAG + ' ActionResult uri:' + ShowNotificationOptions.clickAction.uri)
expect(ShowNotificationOptions.contentTitle).assertEqual('Title8')
expect(ShowNotificationOptions.contentText).assertEqual('This is a notification 008')
expect(ShowNotificationOptions.clickAction.bundleName).assertEqual('com.example.notification')
expect(ShowNotificationOptions.clickAction.abilityName).assertEqual('com.example.notification.MainAbility')
expect(ShowNotificationOptions.clickAction.bundleName).assertEqual('com.example.actsnotificationshow')
expect(ShowNotificationOptions.clickAction.abilityName).assertEqual('com.example.actsnotificationshow.MainAbility')
done()
})
/*
* @tc.number: SUB_NOTIFICATION_SHOW_TEST_0900
* @tc.number: SUB_NOTIFICATION_ANS_SHOW_TEST_0900
* @tc.name: show()
* @tc.desc: verify the function of show
*/
it('SUB_NOTIFICATION_SHOW_TEST_0900', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_SHOW_TEST_0900 START ')
it('SUB_NOTIFICATION_ANS_SHOW_TEST_0900', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_ANS_SHOW_TEST_0900 START ')
let ActionResult = {
bundleName: 'com.example.notification',
abilityName: 'com.example.notification.MainAbility',
bundleName: 'com.example.actsnotificationshow',
abilityName: 'com.example.actsnotificationshow.MainAbility',
uri: '/',
}
let ShowNotificationOptions = {
......@@ -244,22 +244,22 @@ export default function ActsNotificationShowTest() {
console.info(TAG + ' ActionResult abilityName:' + ShowNotificationOptions.clickAction.abilityName)
console.info(TAG + ' ActionResult uri:' + ShowNotificationOptions.clickAction.uri)
expect(ShowNotificationOptions.contentText).assertEqual('This is a notification 009')
expect(ShowNotificationOptions.clickAction.bundleName).assertEqual('com.example.notification')
expect(ShowNotificationOptions.clickAction.abilityName).assertEqual('com.example.notification.MainAbility')
expect(ShowNotificationOptions.clickAction.bundleName).assertEqual('com.example.actsnotificationshow')
expect(ShowNotificationOptions.clickAction.abilityName).assertEqual('com.example.actsnotificationshow.MainAbility')
expect(ShowNotificationOptions.clickAction.uri).assertEqual('/')
done()
})
/*
* @tc.number: SUB_NOTIFICATION_SHOW_TEST_1000
* @tc.number: SUB_NOTIFICATION_ANS_SHOW_TEST_1000
* @tc.name: show()
* @tc.desc: verify the function of show
*/
it('SUB_NOTIFICATION_SHOW_TEST_1000', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_SHOW_TEST_1000 START ')
it('SUB_NOTIFICATION_ANS_SHOW_TEST_1000', 0, async function (done) {
console.info(TAG + 'SUB_NOTIFICATION_ANS_SHOW_TEST_1000 START ')
let ActionResult = {
bundleName: 'com.example.notification',
abilityName: 'com.example.notification.MainAbility',
bundleName: 'com.example.actsnotificationshow',
abilityName: 'com.example.actsnotificationshow.MainAbility',
uri: '/',
}
let ShowNotificationOptions = {
......@@ -272,13 +272,13 @@ export default function ActsNotificationShowTest() {
console.info(TAG + ' ActionResult abilityName:' + ShowNotificationOptions.clickAction.abilityName)
console.info(TAG + ' ActionResult uri:' + ShowNotificationOptions.clickAction.uri)
expect(ShowNotificationOptions.contentTitle).assertEqual('Title10')
expect(ShowNotificationOptions.clickAction.bundleName).assertEqual('com.example.notification')
expect(ShowNotificationOptions.clickAction.abilityName).assertEqual('com.example.notification.MainAbility')
expect(ShowNotificationOptions.clickAction.bundleName).assertEqual('com.example.actsnotificationshow')
expect(ShowNotificationOptions.clickAction.abilityName).assertEqual('com.example.actsnotificationshow.MainAbility')
expect(ShowNotificationOptions.clickAction.uri).assertEqual('/')
done()
})
console.info(TAG + "SUB_NOTIFICATION_SHOW_TEST END");
console.info(TAG + "SUB_NOTIFICATION_ANS_SHOW_TEST END");
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册