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 ?']"; } async gotoRegisterPage(){ await this.page.goto('https://jaicrm1.orderbookings.com/login/'); await this.page.locator(this.registerHereLink).click(); } 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 page.waitForTimeout(5000); 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 page.waitForTimeout(5000); await this.page.locator(this.city).selectOption({label:city}); //await page.waitForTimeout(5000); await this.page.locator(this.password).fill(password); await this.page.locator(this.signupButton).click(); //await page.waitForTimeout(5000); // console.log('Successfully Registered'); // console.log('Email is registered successfully and mail is sent'); // await page.close(); } }