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.
 

57 lines
2.3 KiB

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