exports.OrderPage = class OrderPage { constructor(page) { this.page = page; this.ordersButton="//span[normalize-space()='Orders']"; this.ordersListButton="//a[normalize-space()='Order List']"; this.exportButton="//a[@class='treeview-item active']"; this.orderStatus="//select[@id='oba_edit_order_status_filter']"; this.usernameTextbox="//input[@id='oba_order_search']"; this.textBox="//input[@id='oba_order_search']"; this.filterButton="#oba_edit_order_filter"; this.orderName="//div[normalize-space()='Name : Shubya']"; this.orderEmail="//div[normalize-space()='Email : Shubya111@gmail.com']"; this.orderPhone="//div[normalize-space()='Phone : 919480111222']"; this.orderCost="//td[normalize-space()='200']"; this.orderQty="//tbody/tr[1]/td[6]"; this.orderAddressAPI="//div[normalize-space()='Address : 37, Thomas Mount, 627109']"; } async clickOrdersButton(){ await this.page.locator(this.ordersButton).click(); } async clickOrdersListButton(){ await this.page.locator(this.ordersButton).click(); //await page.waitForTimeout(5000); await this.page.locator(this.ordersListButton).click(); } async orderStatusCheck(orderStatus){ await this.page.locator(this.ordersButton).click(); //await page.waitForTimeout(5000); await this.page.locator(this.ordersListButton).click(); await this.page.locator(this.orderStatus).selectOption({label:orderStatus}); // await page.waitForTimeout(5000); } async checkFilterButton(orderStatus){ await this.page.locator(this.ordersButton).click(); //await page.waitForTimeout(5000); await this.page.locator(this.ordersListButton).click(); await this.page.locator(this.orderStatus).selectOption({label:orderStatus}); // await page.waitForTimeout(5000); await this.page.locator(this.filterButton).click(); } async textBoxSearch(orderStatus, textBox){ await this.page.locator(this.ordersButton).click(); //await page.waitForTimeout(5000); await this.page.locator(this.ordersListButton).click(); await this.page.locator(this.orderStatus).selectOption({label:orderStatus}); // await page.waitForTimeout(5000); await this.page.locator(this.textBox).fill(textBox); await this.page.locator(this.filterButton).click(); } }