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