const {test, expect} =require('@playwright/test') import { RegisterPage } from '../pages/RegisterPage'; /* -------------------------- TEST CASE FOR VALID DETAILS --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ test.describe('GroupWithCorrectDetails',()=>{ // Register Link Check test('RegisterLink Check',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await expect(await page.locator("//button[@class='btn btn-primary btn-block']")).toBeVisible(); }) // Register with correct details test('Register page entering with correct details',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) }) /* ---------------------------------------------------TEST CASES FOR NAME--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ test.describe('TC_Name',()=>{ test('Name with empty space is entered',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_username']"); await expect(locator).toBeFocused(); await expect(locator).toBeVisible(); await page.close(); }) /* //Numbers are accepted as name test('Instead of names, Numbers is entered',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('52658954623', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_username']"); await expect(locator).toBeFocused(); await expect(locator).toBeVisible(); await page.close(); }) test('50 characters are entered',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('dhjdgabjfbdiuafhdkjbaiughjfkshloadfishjkfglik', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_username']"); await expect(locator).toBeFocused(); await expect(locator).toBeVisible(); await page.close(); }) test('Merchant enters special characters and symbol',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('^%$#%$^&*&', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_username']"); await expect(locator).toBeFocused(); await expect(locator).toBeVisible(); await page.close(); }) */ test('Name with Alphabet',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Mano', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible();//already verified again sign up will be displayed. await page.close(); }) test('Name with space',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Mano Aravind', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); //already verified again sign up will be displayed. await page.close(); }) test('Name with special character',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Mano_Aravind', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); //already verified again sign up will be displayed. await page.close(); }) test('Names with accented characters',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Ôôerwed', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); //already verified again sign up will be displayed. await page.close(); }) }) /* ---------------------------------------------------TEST CASES FOR EMAIL ID--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ test.describe('TC_Email',()=>{ test('Email with empty space',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', '','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_emailid']"); await expect(locator).toBeFocused(); await expect(locator).toBeVisible(); await page.close(); }) test('Email without @',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaramgmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_emailid']"); await expect(locator).toBeFocused(); await expect(locator).toBeVisible(); await page.close(); }) test('Email with numbers only',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', '5484564525','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_emailid']"); await expect(locator).toBeFocused(); await expect(locator).toBeVisible(); await page.close(); }) test('Email with special characters only',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', '^&#^*($*$(*%','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_emailid']"); await expect(locator).toBeFocused(); await expect(locator).toBeVisible(); await page.close(); }) test('Email without domain',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_emailid']"); await expect(locator).toBeFocused(); await expect(locator).toBeVisible(); await page.close(); }) /* // functionality doubt test('Email with Upper case letters',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'RABISUNDARAM@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_emailid']"); await expect(locator).toBeFocused(); await expect(locator).toBeVisible(); await page.close(); }) test('Invalid email format',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', ' asfg@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_emailid']"); await expect(locator).toBeFocused(); await expect(locator).toBeVisible(); await page.close(); }) test('Invalid email domain',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'asfg@asfg.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_emailid']"); await expect(locator).toBeFocused(); await expect(locator).toBeVisible(); await page.close(); }) test('Email with Excessive length',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'userudgjhbdsayiujhgbkujhgvbvkujyhgdsakhgjvkdjf!@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_emailid']"); await expect(locator).toBeFocused(); await expect(locator).toBeVisible(); await page.close(); }) test('Email with special character in local part',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) */ test('Email with invalid characters',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'user!@.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_emailid']"); await expect(locator).toBeFocused(); await expect(locator).toBeVisible(); await page.close(); }) test('Email with consecutive dots',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'manoaravcind...com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_emailid']"); await expect(locator).toBeFocused(); await expect(locator).toBeVisible(); await page.close(); }) test('Email with subdomain ',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'example@gmail.example.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) test('Email with uppercase characters',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) }) //-------------------------------------------------TEST CASE FOR PHONE FIELD----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ test.describe('TC_Phone',()=>{ test('Phone number with 10 numbers',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) test('Phone number with 10 characters',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','asdfghjklk','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_phone']"); await expect(locator).toBeFocused(); await page.close(); }) test('Phone number with Special characters',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','%$%^%^&&*','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_phone']"); await expect(locator).toBeFocused(); await page.close(); }) test('Phone with Alphabets',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','ASDFGHJK','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_phone']"); await expect(locator).toBeFocused(); await page.close(); }) test('Phone with 11 numbers',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','96005200465','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_phone']"); await expect(locator).toBeFocused(); await page.close(); }) test('Phone with 9 numbers',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','960052004','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_phone']"); await expect(locator).toBeFocused(); await page.close(); }) test('Phone with starting with space',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'akshay.vasav@gmail.com',' 960052004','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_phone']"); await expect(locator).toBeFocused(); await page.close(); }) test('Phone number empty',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'akshay.vasav@gmail.com',' ','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_phone']"); await expect(locator).toBeFocused(); await page.close(); }) test('Phone with International number',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','123453678798','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_phone']"); await expect(locator).toBeFocused(); await page.close(); }) }) //--------------------------------- TEST CASE FOR ADDRESS FIELD -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- test.describe('TC_Address',()=>{ test('Empty address',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//textarea[@id='oba_signup_address']"); await expect(locator).toBeFocused(); await page.close(); }) /* Need to check showing error test('Exccesive length address',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Main road thalavai panagudim nindia tamil nadu england ntirunelveli gwhsjdas8iukjgbiu7gk uifygh8idhb','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//textarea[@id='oba_signup_address']"); await expect(locator).toBeFocused(); await page.close(); }) test('Except & all other alphanumeric',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','#$@#^%$#@main road','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); const locator = page.locator("//textarea[@id='oba_signup_address']"); await expect(locator).toBeFocused(); await page.close(); }) */ test('Valid Address',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) }) //----------------------------- TEST CASES FOR COMPANY NAME ----------------------------------------------------------------------------------------------------------------------------------------------*/ test.describe('TC_Company Name',()=>{ test('Company name is empty',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', '', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_company_name']"); await expect(locator).toBeFocused(); await page.close(); }) /* These are accepted so need to check with functinality test.only('Company name with numbers',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic 12345', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_company_name']"); await expect(locator).toBeFocused(); await page.close(); }) test.only('Company name with 1000 Alphabets',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'sarhjkfgbdsiugfjksdauygasjbiuadsgbjhsdbauifgadsjhbfuifgj', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_company_name']"); await expect(locator).toBeFocused(); await page.close(); }) test.only('Company name with special characters symbols',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic@1234', 'SweetMart', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_company_name']"); await expect(locator).toBeFocused(); await page.close(); }) */ test('Company name with special characters '-' is acceptable',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram - panagudi ','#12345678A' ,'India(91)', 'Mobigic-Technology', 'SweetMart', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) }) //------------------------------------- TEST CASES FOR BUSINESS MART -----------------------------------------------------------------------------*/ test.describe('TC_BusinessType',()=>{ test('SweetMart Selection',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic-Technology', 'SweetMart', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) test('Fruitmart Selection',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic-Technology', 'FruitMart', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) test('Bisleri supply selection',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic-Technology', 'BisleriSupply', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) test('Others Selection',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) }) //------------------------------------- TEST CASES FOR Password -----------------------------------------------------------------------------*/ test.describe('TC_Password',()=>{ test('minimum 8 length password',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#123456' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_password']"); await expect(locator).toBeFocused(); await page.close(); await page.close(); }) /* //password is space, 25 characters, only special characters are accepted. need to check functions test.only('Password with space',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#123 456' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_password']"); await expect(locator).toBeFocused(); await page.close(); await page.close(); }) test.only('Password entered with 25 characters',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','dsojarlgpojldm905432kjbnk' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_password']"); await expect(locator).toBeFocused(); await page.close(); await page.close(); }) test.only('Password with only special character',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#%^$%^&&**' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_password']"); await expect(locator).toBeFocused(); await page.close(); await page.close(); }) */ test('Password with upper and lower case',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#ADgrdomi' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) test('Too short Password is not accepted',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','1' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); const locator = page.locator("//input[@id='oba_signup_password']"); await expect(locator).toBeFocused(); await page.close(); await page.close(); }) }) //------------------------------------- TEST CASES FOR City ----------------------------------------------------------------------------- test.describe('TC_City',()=>{ test('City Selection',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#1234567A' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) }) //------------------------------------- TEST CASE FOR ALREADY SIGNUP BUTTON ------------------------------------------------------------------------------------------------------------------------------------ test('Already sign up ', async ({page}) =>{ const register = new RegisterPage(page); await register.alreadySignUpCheck(); const locator = page.locator("//input[@name='oba_login_emailid']"); await expect(locator).toBeFocused(); }) //------------------------------------ TEST CASE FOR COUNTRY CODE ------------------------------------------------------------------------------------------------------------------------------------------------------------------- test('India Country code',async ({page})=>{ const register = new RegisterPage(page); await register.gotoRegisterPage(); await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); })