|
const { clear } = require("console");
|
|
|
|
exports.NotificationPage=
|
|
class NotificationPage {
|
|
|
|
constructor(page) {
|
|
this.page = page;
|
|
this.notificationButton="//span[normalize-space()='Notification']";
|
|
this.target = "//select[@id='notification_target']";
|
|
this.title = "//input[@id='notificationtitle']";
|
|
this.content = "//textarea[@id='notificationtext']";
|
|
this.hours = "//select[@id='notification_hours']";
|
|
this.minutes="//select[@id='notification_minutes']";
|
|
this.scheduleNotification="//main[@class='app-content']//button[1]";
|
|
this.sendNotification="//button[2]"
|
|
this.calenderSelector="//input[@id='notification_date']";
|
|
this.monthYear='October 2024';
|
|
this.calenderNext="//div[@class='datepicker-days']//th[@class='next'][normalize-space()='»']";
|
|
}
|
|
|
|
async datePicker(){
|
|
await this.page.locator(this.notificationButton).click();
|
|
//const year="2024";
|
|
//const month="November";
|
|
//const date="5";
|
|
await this.page.locator(this.calenderSelector).click();
|
|
const yearMonth = "January 2025"
|
|
const currentYearMonth=await this.page.locator('this.monthYear').textContent();
|
|
while(true)
|
|
{
|
|
const currentYearMonth=await this.page.locator('this.monthYear').textContent().toString();
|
|
if(currentYearMonth == yearMonth )
|
|
{
|
|
break;
|
|
}
|
|
await this.page.locator(this.calenderNext).click();
|
|
}
|
|
}
|
|
}
|