未验证 提交 54746d79 编写于 作者: O openharmony_ci 提交者: Gitee

!8716 add XTS test

Merge pull request !8716 from liuyanzhi2020/liu0523
......@@ -13,6 +13,7 @@
* limitations under the License.
*/
import commonEvent from '@ohos.commonEvent'
import commonEventManager from '@ohos.commonEventManager'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
export default function ActsSubscriberTestOrder() {
......@@ -538,6 +539,66 @@ export default function ActsSubscriberTestOrder() {
})
console.info(`${TAG} SUB_NOTIFICATION_CES_SUBSCRIBER_ORDER_TEST_0400 END`)
})
/*
* @tc.number: SUB_NOTIFICATION_CES_SUBSCRIBER_ORDER_TEST_0600
* @tc.name: createSubscriber(subscribeInfo: CommonEventSubscribeInfo, undefined): Promise<CommonEventSubscriber>
* @tc.desc: createSubscriber
*/
it('SUB_NOTIFICATION_CES_SUBSCRIBER_ORDER_TEST_0600', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_CES_SUBSCRIBER_ORDER_TEST_0600 START`)
let subscriber
let subscribeInfo = {
events: ["event06"]
}
await commonEvent.createSubscriber(subscribeInfo, undefined).then((commonEventSubscriber) => {
console.info(`SUB_NOTIFICATION_CES_SUBSCRIBER_ORDER_TEST_0600 success ${commonEventSubscriber}`)
subscriber = commonEventSubscriber
expect(true).assertTrue()
done()
}).catch((err) => {
console.info(
`SUB_NOTIFICATION_CES_SUBSCRIBER_ORDER_TEST_0600 err, error code: ${err.code}, message: ${err.message}`)
expect(false).assertTrue()
done()
})
console.info(`${TAG} SUB_NOTIFICATION_CES_SUBSCRIBER_ORDER_TEST_0600 END`)
})
/*
* @tc.number: SUB_NOTIFICATION_CES_SUBSCRIBER_ORDER_TEST_0700
* @tc.name: createSubscriber(subscribeInfo: CommonEventSubscribeInfo, undefined): Promise<CommonEventSubscriber>
* @tc.desc: createSubscriber
*/
it('SUB_NOTIFICATION_CES_SUBSCRIBER_ORDER_TEST_0700', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_CES_SUBSCRIBER_ORDER_TEST_0700 START`)
let subscriber
let subscribeInfo = {
events: ["event07"]
}
await commonEventManager.createSubscriber(subscribeInfo, undefined).then((commonEventSubscriber) => {
console.info(`SUB_NOTIFICATION_CES_SUBSCRIBER_ORDER_TEST_0700 success ${commonEventSubscriber}`)
subscriber = commonEventSubscriber
expect(true).assertTrue()
done()
}).catch((err) => {
console.info(
`SUB_NOTIFICATION_CES_SUBSCRIBER_ORDER_TEST_0700 err, error code: ${err.code}, message: ${err.message}`)
expect(false).assertTrue()
done()
})
console.info(`${TAG} SUB_NOTIFICATION_CES_SUBSCRIBER_ORDER_TEST_0700 END`)
})
console.info(`${TAG} SUB_NOTIFICATION_CES_SUBSCRIBER_ORDER_TEST END`)
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册