OBA Website automated using playwright
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

39 lines
1.5 KiB

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();
}
}
}