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.
 

59 lines
2.0 KiB

exports.CouponPage=
class CouponPage {
constructor(page) {
this.page = page;
this.couponButton="//span[normalize-space()='Coupon']";
this.createCouponButton="//a[normalize-space()='Create coupon']";
this.viewCouponButton="//a[normalize-space()='View coupon']";
this.selectDiscountRule="//select[@id='oba_coupon_criteria']";
this.discountType="//select[@id='oba_coupon_discount_type']";
this.minCartAmount="//input[@id='coupon_dicsount_cart_amount']";
this.enterDiscountAmount="//input[@id='coupon_discount']";
this.calenderSelect="//input[@id='valid_from']";
this.validFromDate="//input[@id='valid_from']";
this.validFromMonth="//input[@id='valid_from']";
this.shortDescription="(//td[contains(text(),'50%OFF')])[2]";
this.descriptionCheck="//td[normalize-space()='Happy Pongal !']";
this.internalCouponValue="//td[normalize-space()='8SHF21213']";
this.couponCode="//td[normalize-space()='Pongal20']";
this.forUsers="(//td[contains(text(),'individual_users')])[3]";
this.shortDescriptionGuest="//td[normalize-space()='15% Offer']";
this.descriptionCheckGuest="//td[normalize-space()='Happy Christmass Makkalae']";
this.internalCouponValueGuest="//td[normalize-space()='dFkhI6142']";
this.couponCodeGuest="//td[normalize-space()='Christmas30']";
this.forUsersGuest="//tbody/tr[6]/td[5]";
}
async CalenderCheck(){
await this.page.locator(this.couponButton).click();
await this.page.locator(this.createCouponButton).click();
await this.page.locator(this.calenderSelect).click();
const year ="2024";
const month ="11";
const date="3";
await this.page.locator(this.validFromDate).fill('11/12/2024');
}
async viewCoupon(){
await this.page.locator(this.couponButton).click();
await this.page.locator(this.viewCouponButton).click();
}
}