exports.RegisterPage = class RegisterPage { constructor(page) { this.page =page; this.registerHereLink="//a[normalize-space()='Register Here ?']"; this.name="//input[@id='oba_signup_username']"; this.email="//input[@id='oba_signup_emailid']"; this.phoneCode ="#oba_signup_phone_code"; this.phoneNumber ="//input[@id='oba_signup_phone']"; this.address="//textarea[@id='oba_signup_address']"; this.companyName="//input[@id='oba_signup_company_name']"; this.businessType="//select[@id='oba_signup_business']"; this.city="//select[@id='oba_signup_city']"; this.password="//input[@id='oba_signup_password']"; this.signupButton=" //button[normalize-space()='SIGN UP']"; this.alreadysignupLink="//a[normalize-space()='Already Sign Up ?']"; } //Navigate to Register Page async gotoRegisterPage(){ await this.page.goto('https://dev.orderbookings.com/login/'); await this.page.locator(this.registerHereLink).click(); } //Check Alreagy sign up working? async alreadySignUpCheck(){ await this.page.goto('https://dev.orderbookings.com/login/'); await this.page.locator(this.registerHereLink).click(); await this.page.locator(this.alreadysignupLink).click(); } //Complete functionality to register async register(name, email, phoneNumber, address, password,phoneCode, companyName, businessType, city){ await this.page.locator(this.name).fill(name); await this.page.locator(this.email).fill(email); await this.page.locator(this.phoneCode).selectOption({label:phoneCode}); await this.page.locator(this.phoneNumber).fill(phoneNumber); await this.page.locator(this.address).fill(address); await this.page.locator(this.companyName).fill(companyName); await this.page.locator(this.businessType).selectOption({label:businessType}); await this.page.locator(this.city).selectOption({label:city}); await this.page.locator(this.password).fill(password); await this.page.locator(this.signupButton).click(); } }