提交 e0402820 编写于 作者: Z zhijianwen

showName

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