exports.LoginPage=
|
|
class LoginPage {
|
|
|
|
constructor(page) {
|
|
this.page = page;
|
|
this.usernameInput = "//input[@name='oba_login_emailid']";
|
|
this.passwordInput = "//input[@placeholder='Password']";
|
|
this.signinButton = "//button[normalize-space()='SIGN IN']";
|
|
this.forgotPassword = "//a[normalize-space()='Forgot Password ?']";
|
|
this.backToLogin="//a[normalize-space()='Back to Login']";
|
|
}
|
|
|
|
async gotoLoginPage(){
|
|
await this.page.goto('https://dev.orderbookings.com/');
|
|
}
|
|
|
|
async login(username, password){
|
|
await this.page.locator(this.usernameInput).fill(username);
|
|
await this.page.locator(this.passwordInput).fill(password);
|
|
await this.page.locator(this.signinButton).click();
|
|
await this.page.waitForTimeout(5000);
|
|
}
|
|
|
|
|
|
|
|
async loginWithCrtPassword(){
|
|
await this.page.fill(this.usernameInput,'xpcv2@rustyload.com');
|
|
await this.page.locator(this.passwordInput).fill('7777777777');
|
|
await this.page.locator(this.signinButton).click();
|
|
}
|
|
|
|
async OpenOBA(){
|
|
|
|
await this.page.goto('https://dev.orderbookings.com/');
|
|
await this.page.fill(this.usernameInput,'xpcv2@rustyload.com');
|
|
await this.page.locator(this.passwordInput).fill('7777777777');
|
|
await this.page.locator(this.signinButton).click();
|
|
|
|
}
|
|
|
|
async forgetPasswordLink(){
|
|
await this.page.locator(this.forgotPassword).click();
|
|
|
|
}
|
|
async backToLoginLink(){
|
|
await this.page.locator(this.backToLogin).click();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|