exports.UserPage=
|
|
class UserPage {
|
|
|
|
constructor(page) {
|
|
this.page = page;
|
|
this.Users = "//span[normalize-space()='Users']";
|
|
this.activeUserButton = "//span[@class='flip-indecator']";
|
|
this.searchUser="//input[@id='oba_user_search']";
|
|
this.enableButton = "//button[@id='66eaa9656b2f4a3d52a42549']";
|
|
this.filterButton="//button[@id='oba_user_search_btn']";
|
|
|
|
//AssertionForAPI
|
|
this.userNameAPI="//td[normalize-space()='DAYA']";
|
|
this.userPhoneAPI="//td[normalize-space()='919480111111']";
|
|
this.userEmailAPI="//td[normalize-space()='Daya1234@gmail.com']";
|
|
this.merchantCode="//a[normalize-space()='919480707707']";
|
|
this.addressAPI="//td[normalize-space()='777777,India,chennai']";
|
|
|
|
//Assertion for address
|
|
this.addressList="//td[normalize-space()='35, Mount Main Road , Tamil Nadu, 123111']";
|
|
this.addressPatch="//td[normalize-space()='35, Mount Kitchen Main Road, Tamil Nadu, 123111']";
|
|
|
|
}
|
|
|
|
//UserPage Button Validation
|
|
async userPageButton(){
|
|
await this.page.locator(this.Users).click();
|
|
|
|
}
|
|
|
|
|
|
//Validate active user button Check
|
|
async activeUserButtonCheck(){
|
|
await this.page.locator(this.Users).click();
|
|
await this.page.locator(this.activeUserButton).click();
|
|
|
|
}
|
|
|
|
//Validate SearchUserValidation
|
|
async searchUserValidation(user){
|
|
await this.page.locator(this.Users).click();
|
|
await this.page.locator(this.searchUser).fill(user);
|
|
await this.page.locator(this.filterButton).click();
|
|
}
|
|
|
|
|
|
//Edit the active user Button
|
|
async activeUserButtonEdit(){
|
|
await this.page.locator(this.Users).click();
|
|
await this.page.locator(this.activeUserButton).click();
|
|
await this.page.locator(this.enableButton).click();
|
|
}
|
|
|
|
//Navigate to user page in API for user details
|
|
async userAPI(){
|
|
await this.page.locator(this.Users).click();
|
|
}
|
|
|
|
//Navigate to user page in API for address
|
|
async addressListAPI(){
|
|
await this.page.locator(this.Users).click();
|
|
|
|
}
|
|
}
|