const {test, expect} =require('@playwright/test') import { RegisterPage } from '../pages/RegisterPage'; test.describe('GroupWithCorrectDetails',()=>{ 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(); //console.log('RegisterLink is working'); }) test('Register page entering with correvt 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'); //console.log('Successfully Registered'); // console.log('Email is registered successfully and mail is sent'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) }) 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'); // console.log('Name is empty it should get error'); await page.close(); }) 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'); // console.log('Number is entered it should get error'); 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'); // console.log('50 Characters is entered it should get error'); 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'); // console.log('Special Characters is entered it should get error'); 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'); //console.log('Alphabets are acceptable'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); 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'); //console.log('Names with Space are acceptable'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); 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'); //console.log('Names with Special character are acceptable'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); 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'); // console.log('Names with accented characters are acceptable'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) }) 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'); //console.log('Email is empty it should get error'); 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'); // console.log('Email without @ symbol it should get error'); 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'); // console.log('Email without domain it should get error'); 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'); // console.log('Invalid email format it should get error'); 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'); // console.log('Invalid email domain it should get error'); 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'); // console.log('Email with invalid characters it should get error'); 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'); //console.log('Email with Excessive length it should get error'); 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'); // console.log('Email with consecutive dots it should get error'); 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'); // console.log('Email with subdomain is accepted'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).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'); //console.log('Email with special character in local part is accepted'); 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'); //console.log('Email with uppercase characters is accepted'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) }) test.describe('TC_Phone',()=>{ 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','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); // console.log('10 characters is not accepted'); 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'); // console.log('10 characters is not accepted'); 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'); // console.log('Special characters is not accepted'); 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'); // console.log('Alphabets is not accepted'); 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'); //console.log('11 numbers is not accepted'); 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'); //console.log('9 numbers is not accepted'); 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'); //console.log('space at the start of the number is not accepted'); 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'); //console.log('blank number is not accepted'); 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'); //console.log('International number is not accepted'); await page.close(); }) }) 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'); //console.log('Empty address is not accepted'); await page.close(); }) 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'); // console.log('Exccesive length address is not accepted'); 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'); //console.log('Except & all other alphanumeric are not accepted'); 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'); //console.log('Valid address'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) }) 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'); //console.log('Company name is empty not acceptable'); await page.close(); }) test('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'); //console.log('Company name with numbers is not acceptable'); await page.close(); }) test('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'); // console.log('Company name with 1000 Alphabets is not acceptable'); await page.close(); }) test('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'); // console.log('Company name with special characters symbols is not acceptable'); 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'); // console.log('Company name with special characters '-' is acceptable'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) }) 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'); // console.log('Sweetmart is selected'); 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'); // console.log('Fruitmart is selected'); 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'); // console.log('BisleriSupply is selected'); 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'); // console.log('Others is selected'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) }) 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'); // console.log('minimum 8 length password is needed, it shows error'); await page.close(); }) test('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'); // console.log('password with space, it shows error'); await page.close(); }) test('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'); // console.log('password with only special character, it shows error'); await page.close(); }) test('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'); //console.log('password with only special character, it shows error'); 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'); // console.log('password with upper and lower case is accepted'); 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'); // console.log('password is too short,it shows error'); await page.close(); }) }) 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'); // console.log('City is selected'); await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); await page.close(); }) })