未验证 提交 791f3447 编写于 作者: O openharmony_ci 提交者: Gitee

!7319 【resourceschedule】【openharmony:monthly_20221018】新增提醒代理模块api9用例

Merge pull request !7319 from 南先森/cherry-pick-1674995203
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
* limitations under the License. * limitations under the License.
*/ */
import ReminderAgentTest from './ReminderAgentJs.test.js' import ReminderAgentTest from './ReminderAgentJs.test.js'
import ReminderAgentManagerTest from './ReminderAgentManagerJs.test.js'
export default function testsuite() { export default function testsuite() {
ReminderAgentTest() ReminderAgentTest()
ReminderAgentManagerTest()
} }
...@@ -2858,89 +2858,6 @@ export default function ReminderAgentTest() { ...@@ -2858,89 +2858,6 @@ export default function ReminderAgentTest() {
done(); done();
}) })
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_XTS_0114
* @tc.name testPublishReminderTypeCalendarFun_0114
* @tc.desc test publish reminders with type of calendar.
*/
it('testPublishReminderTypeCalendarFun_0114', 0, async function (done) {
console.info('----------------------testPublishReminderTypeCalendarFun_0114---------------------------');
let calendar = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_CALENDAR,
dateTime: {
year: 2025,
month: 10,
day: 10,
hour: 23,
minute: 30
},
repeatMonths: [2],
repeatDays: [2],
actionButton: [
{
title: "close",
type: 0
},
{
title: "snooze",
type: 1
}
],
wantAgent: {
pkgName: "com.oh.phone",
abilityName: "com.oh.phone.MainAbility"
},
maxScreenWantAgent: {
pkgName: "com.oh.phone",
abilityName: "com.oh.phone.MainAbility"
},
ringDuration: 5,
snoozeTimes: 2,
timeInterval: 5,
title: "this is title",
content: "this is content",
expiredContent: "this reminder has expired",
snoozeContent: "remind later",
notificationId: 100,
slotType: 3
}
reminderAgent.publishReminder(calendar).then((reminderId) => {
reminderAgent.getValidReminders().then((reminders) => {
for (let i = 0; i < reminders.length; i++) {
console.info("getValidReminders = " + JSON.stringify(reminders[i]));
console.info("getValidReminders, reminderType = " + reminders[i].reminderType);
for (let j = 0; j < reminders[i].actionButton.length; j++) {
console.info("getValidReminders, actionButton.title = " + reminders[i].actionButton[j].title);
console.info("getValidReminders, actionButton.type = " + reminders[i].actionButton[j].type);
}
console.info("getValidReminders, wantAgent.pkgName = " + reminders[i].wantAgent.pkgName);
console.info("getValidReminders, wantAgent.abilityName = " + reminders[i].wantAgent.abilityName);
console.info("getValidReminders, maxScreenWantAgent.pkgName = \
" + reminders[i].maxScreenWantAgent.pkgName);
console.info("getValidReminders, maxScreenWantAgent.abilityName = \
" + reminders[i].maxScreenWantAgent.abilityName);
expect(reminders[i].ringDuration).assertEqual(5);
console.info("getValidReminders, ringDuration = " + reminders[i].ringDuration);
expect(reminders[i].snoozeTimes).assertEqual(2);
console.info("getValidReminders, snoozeTimes = " + reminders[i].snoozeTimes);
console.info("getValidReminders, timeInterval = " + reminders[i].timeInterval);
expect(reminders[i].title).assertEqual("this is title");
console.info("getValidReminders, title = " + reminders[i].title);
expect(reminders[i].content).assertEqual("this is content");
console.info("getValidReminders, content = " + reminders[i].content);
expect(reminders[i].expiredContent).assertEqual("this reminder has expired");
console.info("getValidReminders, expiredContent = " + reminders[i].expiredContent);
expect(reminders[i].snoozeContent).assertEqual("remind later");
console.info("getValidReminders, snoozeContent = " + reminders[i].snoozeContent);
expect(reminders[i].notificationId).assertEqual(100);
console.info("getValidReminders, notificationId = " + reminders[i].notificationId);
console.info("getValidReminders, slotType = " + reminders[i].slotType);
}
})
});
done();
})
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_XTS_0115 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_XTS_0115
* @tc.name testActionButtonType_0115 * @tc.name testActionButtonType_0115
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册