提交 e98d23a4 编写于 作者: N nan-xiansen 提交者: 南先森

fixed b5421496 from https://gitee.com/nan-xiansen/xts_acts/pulls/7318

【resourceschedule】新增提醒代理模块api9用例
Signed-off-by: Nnan-xiansen <nanjinbin@huawei.com>
Change-Id: I7f208314b90f19f88b05b397656f8196fbcdb8e3
上级 7627f2c3
......@@ -13,6 +13,9 @@
* limitations under the License.
*/
import ReminderAgentTest from './ReminderAgentJs.test.js'
import ReminderAgentManagerTest from './ReminderAgentManagerJs.test.js'
export default function testsuite() {
ReminderAgentTest()
ReminderAgentManagerTest()
}
......@@ -2858,89 +2858,6 @@ export default function ReminderAgentTest() {
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.name testActionButtonType_0115
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册