未验证 提交 9ce8d13a 编写于 作者: O openharmony_ci 提交者: Gitee

!2788 Modify use case

Merge pull request !2788 from 火箭龟/release_322
...@@ -107,10 +107,10 @@ describe('ReminderAgentTest', function () { ...@@ -107,10 +107,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_003 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_003
* @tc.name testAddNotificationSlotNorFun001 * @tc.name testAddNotificationSlotNorFun003
* @tc.desc Adds a reminder notification slot with the callback function. * @tc.desc Adds a reminder notification slot with the callback function.
*/ */
it('testAddNotificationSlotNorFun001', 0, async function (done) { it('testAddNotificationSlotNorFun003', 0, async function (done) {
function reminderCallback(err, data) { function reminderCallback(err, data) {
let i = 0; let i = 0;
expect(0).assertEqual(i); expect(0).assertEqual(i);
...@@ -121,10 +121,10 @@ describe('ReminderAgentTest', function () { ...@@ -121,10 +121,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_004 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_004
* @tc.name testAddNotificationSlotNorFun002 * @tc.name testAddNotificationSlotNorFun004
* @tc.desc Adds a reminder notification slot with the promise function and null mySlot. * @tc.desc Adds a reminder notification slot with the promise function and null mySlot.
*/ */
it('testAddNotificationSlotNorFun002', 0, async function (done) { it('testAddNotificationSlotNorFun004', 0, async function (done) {
let mySlot = null; let mySlot = null;
try { try {
reminderAgent.addNotificationSlot(mySlot,function(err) { reminderAgent.addNotificationSlot(mySlot,function(err) {
...@@ -145,10 +145,10 @@ describe('ReminderAgentTest', function () { ...@@ -145,10 +145,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_005 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_005
* @tc.name testAddNotificationSlotNorFun003 * @tc.name testAddNotificationSlotNorFun005
* @tc.desc Adds a reminder notification slot with the promise function and mySlot type 3. * @tc.desc Adds a reminder notification slot with the promise function and mySlot type 3.
*/ */
it('testAddNotificationSlotNorFun003', 0, async function (done) { it('testAddNotificationSlotNorFun005', 0, async function (done) {
let mySlot = { let mySlot = {
type: 3 type: 3
} }
...@@ -167,10 +167,10 @@ describe('ReminderAgentTest', function () { ...@@ -167,10 +167,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_006 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_006
* @tc.name testAddNotificationSlotNorFun004 * @tc.name testAddNotificationSlotNorFun006
* @tc.desc Adds a reminder notification slot with the promise function and mySlot more types. * @tc.desc Adds a reminder notification slot with the promise function and mySlot more types.
*/ */
it('testAddNotificationSlotNorFun004', 0, async function (done) { it('testAddNotificationSlotNorFun006', 0, async function (done) {
let mySlot0 = { let mySlot0 = {
type: 0 type: 0
} }
...@@ -205,10 +205,10 @@ describe('ReminderAgentTest', function () { ...@@ -205,10 +205,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_007 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_007
* @tc.name testGetValidRemindersNorFun001 * @tc.name testGetValidRemindersNorFun007
* @tc.desc Obtains all valid remindeers set by the current application. * @tc.desc Obtains all valid remindeers set by the current application.
*/ */
it('testGetValidRemindersNorFun001', 0, async function (done) { it('testGetValidRemindersNorFun007', 0, async function (done) {
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS
...@@ -228,10 +228,10 @@ describe('ReminderAgentTest', function () { ...@@ -228,10 +228,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_008 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_008
* @tc.name testCancelAllRemindersNorFun001 * @tc.name testCancelAllRemindersNorFun008
* @tc.desc test cancel all reminders can cancel all exist reminders * @tc.desc test cancel all reminders can cancel all exist reminders
*/ */
it('testCancelAllRemindersNorFun001', 0, async function (done) { it('testCancelAllRemindersNorFun008', 0, async function (done) {
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS
...@@ -251,10 +251,10 @@ describe('ReminderAgentTest', function () { ...@@ -251,10 +251,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_009 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_009
* @tc.name testCancelRemindersNorFun001 * @tc.name testCancelRemindersNorFun009
* @tc.desc test cancelReminder with not exit reminder. * @tc.desc test cancelReminder with not exit reminder.
*/ */
it('testCancelRemindersNorFun001', 0, async function (done) { it('testCancelRemindersNorFun009', 0, async function (done) {
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS
...@@ -284,10 +284,10 @@ describe('ReminderAgentTest', function () { ...@@ -284,10 +284,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_010 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_010
* @tc.name testCancelRemindersNorFun002 * @tc.name testCancelRemindersNorFun010
* @tc.desc test cancel reminder with not exit reminder. * @tc.desc test cancel reminder with not exit reminder.
*/ */
it('testCancelRemindersNorFun002', 0, async function (done) { it('testCancelRemindersNorFun010', 0, async function (done) {
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS
...@@ -317,10 +317,10 @@ describe('ReminderAgentTest', function () { ...@@ -317,10 +317,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_011 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_011
* @tc.name testCancelRemindersNorFun003 * @tc.name testCancelRemindersNorFun011
* @tc.desc test cancel reminder with exist reminder. * @tc.desc test cancel reminder with exist reminder.
*/ */
it('testCancelRemindersNorFun003', 0, async function (done) { it('testCancelRemindersNorFun011', 0, async function (done) {
let alarm = { let alarm = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM,
hour: 21, hour: 21,
...@@ -354,10 +354,10 @@ describe('ReminderAgentTest', function () { ...@@ -354,10 +354,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_012 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_012
* @tc.name testCancelRemindersNorFun004 * @tc.name testCancelRemindersNorFun012
* @tc.desc test cancel reminder with exist reminder with the promise function. * @tc.desc test cancel reminder with exist reminder with the promise function.
*/ */
it('testCancelRemindersNorFun004', 0, async function (done) { it('testCancelRemindersNorFun012', 0, async function (done) {
let alarm = { let alarm = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM,
hour: 21, hour: 21,
...@@ -391,18 +391,18 @@ describe('ReminderAgentTest', function () { ...@@ -391,18 +391,18 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_013 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_013
* @tc.name testGetValidRemindersNorFun002 * @tc.name testGetValidRemindersNorFun013
* @tc.desc test get valid reminders verify all the information is correct. * @tc.desc test get valid reminders verify all the information is correct.
*/ */
it('testGetValidRemindersNorFun002', 0, async function (done) { it('testGetValidRemindersNorFun013', 0, async function (done) {
var alarm = { let alarm = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM,
hour: 21, hour: 21,
minute: 14, minute: 14,
title: "this is title", title: "this is title",
content: "this is content" content: "this is content"
} }
var timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS
} }
...@@ -421,18 +421,18 @@ describe('ReminderAgentTest', function () { ...@@ -421,18 +421,18 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_014 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_014
* @tc.name testGetValidRemindersNorFun003 * @tc.name testGetValidRemindersNorFun014
* @tc.desc test get valid reminders verify all the information is correct with the callback function. * @tc.desc test get valid reminders verify all the information is correct with the callback function.
*/ */
it('testGetValidRemindersNorFun003', 0, async function (done) { it('testGetValidRemindersNorFun014', 0, async function (done) {
var alarm = { let alarm = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM,
hour: 21, hour: 21,
minute: 14, minute: 14,
title: "this is title", title: "this is title",
content: "this is content" content: "this is content"
} }
var timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS
} }
...@@ -451,10 +451,10 @@ describe('ReminderAgentTest', function () { ...@@ -451,10 +451,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_015 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_015
* @tc.name testRemonveNotificationSlotNorFun001 * @tc.name testRemonveNotificationSlotNorFun015
* @tc.desc test remove notification Slot with not exist slot. * @tc.desc test remove notification Slot with not exist slot.
*/ */
it('testRemonveNotificationSlotNorFun001', 0, async function (done) { it('testRemonveNotificationSlotNorFun015', 0, async function (done) {
function reminderCallback(err, data) { function reminderCallback(err, data) {
let i = 0; let i = 0;
expect(0).assertEqual(i); expect(0).assertEqual(i);
...@@ -465,10 +465,10 @@ describe('ReminderAgentTest', function () { ...@@ -465,10 +465,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_016 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_016
* @tc.name testRemonveNotificationSlotNorFun002 * @tc.name testRemonveNotificationSlotNorFun016
* @tc.desc test remove notification Slot with not exist slot with the promise function. * @tc.desc test remove notification Slot with not exist slot with the promise function.
*/ */
it('testRemonveNotificationSlotNorFun002', 0, async function (done) { it('testRemonveNotificationSlotNorFun016', 0, async function (done) {
let promise = new Promise((resolve, reject) => { let promise = new Promise((resolve, reject) => {
reminderAgent.removeNotificationSlot(1).then(() => { reminderAgent.removeNotificationSlot(1).then(() => {
resolve(); resolve();
...@@ -485,10 +485,10 @@ describe('ReminderAgentTest', function () { ...@@ -485,10 +485,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_017 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_017
* @tc.name testRemonveNotificationSlotNorFun003 * @tc.name testRemonveNotificationSlotNorFun017
* @tc.desc test remove notification Slot with exist slot. * @tc.desc test remove notification Slot with exist slot.
*/ */
it('testRemonveNotificationSlotNorFun003', 0, async function (done) { it('testRemonveNotificationSlotNorFun017', 0, async function (done) {
let tarRemoveSlot = { let tarRemoveSlot = {
type: 1 type: 1
} }
...@@ -502,10 +502,10 @@ describe('ReminderAgentTest', function () { ...@@ -502,10 +502,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_018 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_018
* @tc.name testRemonveNotificationSlotNorFun004 * @tc.name testRemonveNotificationSlotNorFun018
* @tc.desc test remove notification Slot with exist slot with the promise function. * @tc.desc test remove notification Slot with exist slot with the promise function.
*/ */
it('testRemonveNotificationSlotNorFun004', 0, async function (done) { it('testRemonveNotificationSlotNorFun018', 0, async function (done) {
let tarRemoveSlot = { let tarRemoveSlot = {
type: 1 type: 1
} }
...@@ -519,10 +519,10 @@ describe('ReminderAgentTest', function () { ...@@ -519,10 +519,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_019 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_019
* @tc.name testGetValidRemindersNorFun004 * @tc.name testGetValidRemindersNorFun019
* @tc.desc test get valid reminders with promise function. * @tc.desc test get valid reminders with promise function.
*/ */
it('testGetValidRemindersNorFun004', 0, async function (done) { it('testGetValidRemindersNorFun019', 0, async function (done) {
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: 3 triggerTimeInSeconds: 3
...@@ -538,10 +538,10 @@ describe('ReminderAgentTest', function () { ...@@ -538,10 +538,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_020 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_020
* @tc.name testGetValidRemindersNorFun005 * @tc.name testGetValidRemindersNorFun020
* @tc.desc test get valid reminders with the callback function. * @tc.desc test get valid reminders with the callback function.
*/ */
it('testGetValidRemindersNorFun005', 0, async function (done) { it('testGetValidRemindersNorFun020', 0, async function (done) {
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: 3 triggerTimeInSeconds: 3
...@@ -557,10 +557,10 @@ describe('ReminderAgentTest', function () { ...@@ -557,10 +557,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_021 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_021
* @tc.name testPublishReminderNorAlarmFun001 * @tc.name testPublishReminderNorAlarmFun021
* @tc.desc test publish reminder with a nomal alarm promise function. * @tc.desc test publish reminder with a nomal alarm promise function.
*/ */
it('testPublishReminderNorAlarmFun001', 0, async function (done) { it('testPublishReminderNorAlarmFun021', 0, async function (done) {
let alarm = { let alarm = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM,
hour: 21, hour: 21,
...@@ -577,10 +577,10 @@ describe('ReminderAgentTest', function () { ...@@ -577,10 +577,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_022 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_022
* @tc.name testPublishReminderNorAlarmFun002 * @tc.name testPublishReminderNorAlarmFun022
* @tc.desc test publish reminder with a nomal alarm callback function. * @tc.desc test publish reminder with a nomal alarm callback function.
*/ */
it('testPublishReminderNorAlarmFun002', 0, async function (done) { it('testPublishReminderNorAlarmFun022', 0, async function (done) {
let alarm = { let alarm = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM,
hour: 21, hour: 21,
...@@ -598,10 +598,10 @@ describe('ReminderAgentTest', function () { ...@@ -598,10 +598,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_023 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_023
* @tc.name testPublishReminderAbNorFun001 * @tc.name testPublishReminderAbNorFun023
* @tc.desc test publish reminder with max number limit of each application. * @tc.desc test publish reminder with max number limit of each application.
*/ */
it('testPublishReminderAbNorFun001', 0, async function (done) { it('testPublishReminderAbNorFun023', 0, async function (done) {
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS
...@@ -631,10 +631,10 @@ describe('ReminderAgentTest', function () { ...@@ -631,10 +631,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_024 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_024
* @tc.name testReminderTypeCalendarFun001 * @tc.name testReminderTypeCalendarFun024
* @tc.desc test cancelAllReminders can cancel all exist reminders with type of calendar. * @tc.desc test cancelAllReminders can cancel all exist reminders with type of calendar.
*/ */
it('testReminderTypeCalendarFun001', 0, async function (done) { it('testReminderTypeCalendarFun024', 0, async function (done) {
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: 100 triggerTimeInSeconds: 100
...@@ -663,10 +663,10 @@ describe('ReminderAgentTest', function () { ...@@ -663,10 +663,10 @@ describe('ReminderAgentTest', function () {
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_025 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_025
* @tc.name testPublishReminderTypeCalendarFun001 * @tc.name testPublishReminderTypeCalendarFun025
* @tc.desc test pulish reminders with type of calendar. * @tc.desc test pulish reminders with type of calendar.
*/ */
it('testReminderTypeCalendarFun001', 0, async function (done) { it('testReminderTypeCalendarFun025', 0, async function (done) {
let calendar = { let calendar = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_CALENDAR, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_CALENDAR,
dateTime : { dateTime : {
...@@ -742,11 +742,11 @@ describe('ReminderAgentTest', function () { ...@@ -742,11 +742,11 @@ describe('ReminderAgentTest', function () {
}) })
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_071 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_026
* @tc.name testActionButtonTypeClose001 * @tc.name testActionButtonTypeClose026
* @tc.desc test acton butto type is close. * @tc.desc test acton butto type is close.
*/ */
it('testActionButtonTypeClose001', 0, async function (done) { it('testActionButtonTypeClose026', 0, async function (done) {
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.ACTION_BUTTON_TYPE_CLOSE, reminderType: reminderAgent.ReminderType.ACTION_BUTTON_TYPE_CLOSE,
triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS
...@@ -763,11 +763,11 @@ describe('ReminderAgentTest', function () { ...@@ -763,11 +763,11 @@ describe('ReminderAgentTest', function () {
}) })
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_072 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_027
* @tc.name testActionButtonTypeSnooze001 * @tc.name testActionButtonTypeSnooze027
* @tc.desc test acton butto type is snooze. * @tc.desc test acton butto type is snooze.
*/ */
it('testActionButtonTypeSnooze001', 0, async function (done) { it('testActionButtonTypeSnooze027', 0, async function (done) {
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.ACTION_BUTTON_TYPE_SNOOZE, reminderType: reminderAgent.ReminderType.ACTION_BUTTON_TYPE_SNOOZE,
triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS
...@@ -784,36 +784,46 @@ describe('ReminderAgentTest', function () { ...@@ -784,36 +784,46 @@ describe('ReminderAgentTest', function () {
}) })
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_073 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_028
* @tc.name testActionButtonType001 * @tc.name testActionButtonType028
* @tc.desc test acton butto type type = 0. * @tc.desc test acton butto type type = 0.
*/ */
it("testActionButtonType001", 0, async function (done) { it("testActionButtonType028", 0, async function (done) {
console.log('----------------------testActionButtonType001---------------------------'); console.log('----------------------qigongmingtestActionButtonType028---------------------------');
let type1 = reminderAgent.ActionButtonType.ACTION_BUTTON_TYPE_CLOSE; let type1 = reminderAgent.ActionButtonType.ACTION_BUTTON_TYPE_CLOSE;
except(type1).assertEqual(0); console.log(type1 + typeof(type1));
if (type1 == 0) {
expect(true).assertTrue();
} else {
except(false).assertTrue();
}
done(); done();
}) })
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_074 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_029
* @tc.name testActionButtonType002 * @tc.name testActionButtonType029
* @tc.desc test acton butto type type = 0. * @tc.desc test acton butto type type = 0.
*/ */
it("testActionButtonType002", 0, async function (done) { it("testActionButtonType029", 0, async function (done) {
console.log('----------------------testActionButtonType002---------------------------'); console.log('----------------------testActionButtonType029---------------------------');
let type1 = reminderAgent.ActionButtonType.ACTION_BUTTON_TYPE_SNOOZE; let type1 = reminderAgent.ActionButtonType.ACTION_BUTTON_TYPE_SNOOZE;
except(type1).assertEqual(1); console.log(type1 + typeof(type1));
if (type1 == 1) {
expect(true).assertTrue();
} else {
except(false).assertTrue();
}
done(); done();
}) })
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_075 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_030
* @tc.name testActionButton001 * @tc.name testActionButton030
* @tc.desc test ActionButton title. * @tc.desc test ActionButton title.
*/ */
it("testActionButton001", 0, async function (done) { it("testActionButton030", 0, async function (done) {
console.log('----------------------testActionButton001---------------------------'); console.log('----------------------testActionButton030---------------------------');
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS
...@@ -831,7 +841,7 @@ describe('ReminderAgentTest', function () { ...@@ -831,7 +841,7 @@ describe('ReminderAgentTest', function () {
expect(false).assertEqual(false); expect(false).assertEqual(false);
} }
},(error) => { },(error) => {
expect(false).assertEqual(); expect(false).assertTrue();
}); });
}); });
...@@ -841,12 +851,12 @@ describe('ReminderAgentTest', function () { ...@@ -841,12 +851,12 @@ describe('ReminderAgentTest', function () {
}) })
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_076 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_031
* @tc.name testActionButton002 * @tc.name testActionButton031
* @tc.desc test ActionButton * @tc.desc test ActionButton
*/ */
it("testActionButton002", 0, async function (done) { it("testActionButton031", 0, async function (done) {
console.log('----------------------testActionButton002---------------------------'); console.log('----------------------testActionButton031---------------------------');
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS
...@@ -862,11 +872,11 @@ describe('ReminderAgentTest', function () { ...@@ -862,11 +872,11 @@ describe('ReminderAgentTest', function () {
console.log('ActionButton type:' + actionButton[0].type); console.log('ActionButton type:' + actionButton[0].type);
} else { } else {
reminder = [{actionButton: [{type: 1}]}]; reminder = [{actionButton: [{type: 1}]}];
console.log('ActionButtonType: ' + reminder[0].actionButton[0].type); console.log('ActionButton Type: ' + reminder[0].actionButton[0].type);
expect(false).assertEqual(false); expect(true).assertTrue();
} }
},(error) => { },(error) => {
expect(false).assertEqual(); expect(false).assertTrue();
}); });
}); });
...@@ -876,29 +886,32 @@ describe('ReminderAgentTest', function () { ...@@ -876,29 +886,32 @@ describe('ReminderAgentTest', function () {
}) })
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_077 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_032
* @tc.name testWantAgentAbilityName001 * @tc.name testWantAgentAbilityName032
* @tc.desc test wantAgent abilityName * @tc.desc test wantAgent abilityName
*/ */
it("testWantAgentAbilityName001", 0, async function (done) { it("testWantAgentAbilityName032", 0, async function (done) {
console.log('----------------------testWantAgentAbilityName001---------------------------'); console.log('----------------------testWantAgentAbilityName032---------------------------');
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS triggerTimeInSeconds: 4,
} wantAgent: {
pkgName: "ohos.samples.jshelloworld",
abilityName: "ohos.samples.jshelloworld.MainAbility"
},
};
reminderAgent.publishReminder(timer).then((reminderId) => { reminderAgent.publishReminder(timer).then((reminderId) => {
console.log("reminderId =" + reminderId); console.log("reminderId =" + reminderId);
reminderAgent.getValidReminders().then((reminder) => { reminderAgent.getValidReminders((err, reminder) => {
if(reminder.length !== 0) { if(reminder.length !== 0) {
let wantAgent = reminder[0].wantAgent; let wantAgent = reminder[0].wantAgent.abilityName;
console.log('WantAgent abilityName:' + wantAgent.abilityName); //expect(wantAgent).assertEqual("ohos.samples.jshelloworld.MainAbility");
} else { if (wantAgent == "ohos.samples.jshelloworld.MainAbility") {
reminder = [{wantAgent: {abilityName: 'title.com.oh.phone.MainAbility'}}]; expect(true).assertTrue();
console.log('WantAgent abilityName:' + reminder[0].wantAgent.abilityName); } else {
expect(false).assertEqual(false); expect(false).assertTrue();
}; }
},(error) => { }
expect(false).assertEqual();
}); });
}); });
...@@ -908,12 +921,12 @@ describe('ReminderAgentTest', function () { ...@@ -908,12 +921,12 @@ describe('ReminderAgentTest', function () {
}) })
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_078 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_033
* @tc.name testMaxScreenWantAgentAbilityName001 * @tc.name testMaxScreenWantAgentAbilityName033
* @tc.desc test MaxScreenWantAgent abilityName * @tc.desc test MaxScreenWantAgent abilityName
*/ */
it("testMaxScreenWantAgentAbilityName001", 0, async function (done) { it("testMaxScreenWantAgentAbilityName033", 0, async function (done) {
console.log('----------------------testMaxScreenWantAgentAbilityName001---------------------------'); console.log('----------------------testMaxScreenWantAgentAbilityName033---------------------------');
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS
...@@ -929,7 +942,7 @@ describe('ReminderAgentTest', function () { ...@@ -929,7 +942,7 @@ describe('ReminderAgentTest', function () {
expect(false).assertEqual(false); expect(false).assertEqual(false);
}; };
},(error) => { },(error) => {
expect(false).assertEqual(); expect(false).assertTrue();
}); });
}); });
...@@ -939,12 +952,12 @@ describe('ReminderAgentTest', function () { ...@@ -939,12 +952,12 @@ describe('ReminderAgentTest', function () {
}) })
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_079 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_034
* @tc.name testReminderRequestTitle001 * @tc.name testReminderRequestTitle034
* @tc.desc test ReminderRequest title * @tc.desc test ReminderRequest title
*/ */
it("testReminderRequestTitle001", 0, async function (done) { it("testReminderRequestTitle034", 0, async function (done) {
console.log('----------------------testReminderRequestTitle001---------------------------'); console.log('----------------------testReminderRequestTitle034---------------------------');
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS
...@@ -961,7 +974,7 @@ describe('ReminderAgentTest', function () { ...@@ -961,7 +974,7 @@ describe('ReminderAgentTest', function () {
expect(false).assertEqual(false); expect(false).assertEqual(false);
}; };
},(error) => { },(error) => {
expect(false).assertEqual(); expect(false).assertTrue();
}); });
}); });
...@@ -971,12 +984,12 @@ describe('ReminderAgentTest', function () { ...@@ -971,12 +984,12 @@ describe('ReminderAgentTest', function () {
}) })
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_080 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_035
* @tc.name testReminderRequestContent001 * @tc.name testReminderRequestContent035
* @tc.desc test ReminderRequest content * @tc.desc test ReminderRequest content
*/ */
it("testReminderRequestContent001", 0, async function (done) { it("testReminderRequestContent035", 0, async function (done) {
console.log('----------------------testReminderRequestContent001---------------------------'); console.log('----------------------testReminderRequestContent035---------------------------');
let timer = { let timer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS triggerTimeInSeconds: TRIGGER_TIME_IN_SECONDS
...@@ -993,7 +1006,7 @@ describe('ReminderAgentTest', function () { ...@@ -993,7 +1006,7 @@ describe('ReminderAgentTest', function () {
expect(false).assertEqual(false); expect(false).assertEqual(false);
}; };
},(error) => { },(error) => {
expect(false).assertEqual(); expect(false).assertTrue();
}); });
}); });
...@@ -1003,12 +1016,12 @@ describe('ReminderAgentTest', function () { ...@@ -1003,12 +1016,12 @@ describe('ReminderAgentTest', function () {
}) })
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_081 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_036
* @tc.name testReminderRequestType001 * @tc.name testReminderRequestType036
* @tc.desc test ReminderRequest LocalDateTime second * @tc.desc test ReminderRequest LocalDateTime second
*/ */
it("testReminderRequestType001", 0, async function (done) { it("testReminderRequestType036", 0, async function (done) {
console.log('----------------------testReminderRequestType001---------------------------'); console.log('----------------------testReminderRequestType036---------------------------');
let calendar = { let calendar = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_CALENDAR, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_CALENDAR,
dateTime: { dateTime: {
...@@ -1030,22 +1043,25 @@ describe('ReminderAgentTest', function () { ...@@ -1030,22 +1043,25 @@ describe('ReminderAgentTest', function () {
}) })
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_082 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_037
* @tc.name testReminderRequestType002 * @tc.name testReminderRequestType037
* @tc.desc test ReminderRequest ReminderRequestAlarm daysOfWeek * @tc.desc test ReminderRequest ReminderRequestAlarm daysOfWeek
*/ */
it("testReminderRequestType002", 0, async function (done) { it("testReminderRequestType037", 0, async function (done) {
console.log('----------------------testReminderRequestType002---------------------------'); console.log('----------------------testReminderRequestType037---------------------------');
let alarm = { let alarm = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM,
reminderRequestAlarm: { hour: 7,
hour: 7, minute: 10,
minute: 10, daysOfWeek: [1,2,3,4,5]
daysOfWeek: [1,2,3,4,5]
}
} }
reminderAgent.publishReminder(alarm).then((reminderId) => { reminderAgent.publishReminder(alarm).then((reminderId) => {
if (reminderId != -1) {
expect(true).assertTrue();
}
console.log("reminderId =" + reminderId); console.log("reminderId =" + reminderId);
},error => {
expect(false).assertTrue();
}); });
setTimeout(() => { setTimeout(() => {
......
...@@ -898,10 +898,10 @@ describe("WorkSchedulerJsTest", function () { ...@@ -898,10 +898,10 @@ describe("WorkSchedulerJsTest", function () {
it("WorkSchedulerJsTest046", 0, async function (done) { it("WorkSchedulerJsTest046", 0, async function (done) {
console.info('----------------------WorkSchedulerJsTest046---------------------------'); console.info('----------------------WorkSchedulerJsTest046---------------------------');
let workInfo = { let workInfo = {
workId: 7, workId: 5,
bundleName: "ohos.acts.resourceschedule.workscheduler.js.function", bundleName: "ohos.acts.resourceschedule.workscheduler.js.function",
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
networkType: NETWORK_TYPE_ANY networkType: workScheduler.NetworkType.NETWORK_TYPE_ANY
} }
let res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false); expect(res).assertEqual(false);
...@@ -955,7 +955,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -955,7 +955,7 @@ describe("WorkSchedulerJsTest", function () {
* @tc.type: FUNC * @tc.type: FUNC
* @tc.require: * @tc.require:
*/ */
it("WorkSchedulerJsTest049", 0, async function (done) { /*it("WorkSchedulerJsTest049", 0, async function (done) {
console.info('----------------------WorkSchedulerJsTest049---------------------------'); console.info('----------------------WorkSchedulerJsTest049---------------------------');
let workInfo = { let workInfo = {
workId: 2, workId: 2,
...@@ -965,7 +965,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -965,7 +965,7 @@ describe("WorkSchedulerJsTest", function () {
var res = workScheduler.onWorkStart(workInfo); var res = workScheduler.onWorkStart(workInfo);
expect(res).assertEqual(false); expect(res).assertEqual(false);
done(); done();
}) })*/
/* /*
* @tc.name: WorkSchedulerJsTest050 * @tc.name: WorkSchedulerJsTest050
...@@ -973,7 +973,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -973,7 +973,7 @@ describe("WorkSchedulerJsTest", function () {
* @tc.type: FUNC * @tc.type: FUNC
* @tc.require: * @tc.require:
*/ */
it("WorkSchedulerJsTest050", 0, async function (done) { /*it("WorkSchedulerJsTest050", 0, async function (done) {
console.info('----------------------WorkSchedulerJsTest050---------------------------'); console.info('----------------------WorkSchedulerJsTest050---------------------------');
let workInfo = { let workInfo = {
workId: 2, workId: 2,
...@@ -983,7 +983,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -983,7 +983,7 @@ describe("WorkSchedulerJsTest", function () {
var stopRes = workSchedulerCallback.onWorkStop(workInfo, true); var stopRes = workSchedulerCallback.onWorkStop(workInfo, true);
expect(stopRes).assertEqual(false); expect(stopRes).assertEqual(false);
done(); done();
}) })*/
/* /*
* @tc.name: WorkSchedulerJsTest051 * @tc.name: WorkSchedulerJsTest051
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册