exports.CatlogPage= class CatlogPage { constructor(page) { this.page = page; this.catlogButton="//span[normalize-space()='Catlog']"; this.catalogViewType="//select[@id='oba_bud_view']"; this.productsViewType="//select[@id='oba_product_view']"; this.categoryImage="#edit_image"; this.uploadImage="#oba_product_input_display"; this.saveButton="//button[@class='btn btn-primary btn-block']"; } async clickCatalogButton(){ await this.page.locator(this.catlogButton).click(); } async clickCatalogViewType(catlogView){ await this.page.locator(this.catlogButton).click(); await this.page.locator(this.catalogViewType).selectOption({label:catlogView}); } async clickProductViewType(catlogView, productView ){ await this.page.locator(this.catlogButton).click(); await this.page.locator(this.catalogViewType).selectOption({label:catlogView}); await this.page.locator(this.productsViewType).selectOption({label:productView}); } async imageUpload(catlogView, productView ){ await this.page.locator(this.catlogButton).click(); await this.page.locator(this.catalogViewType).selectOption({label:catlogView}); await this.page.locator(this.productsViewType).selectOption({label:productView}); await this.page.locator(this.categoryImage).click(); await this.page.locator(this.uploadImage).setInputFiles("C:/Automate Testing/OBA Automation/Biriyani.jpg"); await this.page.locator(this.saveButton).click(); } async imageUpload(catlogView, productView ){ await this.page.locator(this.catlogButton).click(); await this.page.locator(this.catalogViewType).selectOption({label:catlogView}); await this.page.locator(this.productsViewType).selectOption({label:productView}); await this.page.locator(this.categoryImage).click(); await this.page.locator(this.uploadImage).setInputFiles("C:/Automate Testing/OBA Automation/Biriyani.jpg"); await this.page.locator(this.saveButton).click(); } } //await this.page.locator("#edit_image").click(); //await this.page.locator("#oba_product_input_display").setInputFiles("C:/Automate Testing/OBA Automation/Biriyani.jpg"); //await this.page.locator(this.saveButton).click();