Author | SHA1 | Message | Date |
---|---|---|---|
|
89e8ac285d | need to correct Commit | 7 months ago |
|
e42891bb9c |
reviewing the code
adding comments in code follow those suggestions |
7 months ago |
|
0cc194b743 | Checked Commit | 7 months ago |
|
3459003c7b | Updated Commit | 8 months ago |
|
92f49823e4 | Updated Commit | 8 months ago |
|
9ccffcc2b8 | Second commit | 11 months ago |
|
c53965b4e8 | Second commit | 11 months ago |
|
63e08c1d1f | TestCases for login and register commited using POM. | 11 months ago |
@ -0,0 +1,72 @@ | |||||
exports.AppConfig= | |||||
class AppConfig { | |||||
constructor(page) { | |||||
this.page = page; | |||||
this.onOffButton="//div[@class='card is_shop_open_card']//span[@class='flip-indecator']"; | |||||
this.appConfLink="//span[normalize-space()='AppConfig']"; | |||||
this.appconfIsShopOpen="//label[normalize-space()='Is Shop Open ?']"; | |||||
this.currency="//select[@id='oba_appconfig_select_currency']"; | |||||
this.notificationSoundLoop="//input[@id='oba_notification_sound_loop']"; | |||||
this.cancellationTill="//input[@id='oba_cancellation_till']"; | |||||
this.minimumCartPrize="//label[@id='oba_appconfig_minimum_cart_price_label']//input[@id='oba_appconfig_minimum_cart_price']"; | |||||
this.deliveryCharge="//label[@id='oba_appconfig_delivery_charge_label']//input[@id='oba_appconfig_minimum_cart_price']"; | |||||
this.callToAction="//input[@id='oba_appconfig_call_to_action']"; | |||||
this.areaSelection="//select[@id='oba_appconfig_city_selection_list']"; | |||||
this.typingText="//input[@id='oba_appconfig_area_selection']"; | |||||
this.selectedText="//select[@id='oba_appconfig_area_selection_list']"; | |||||
this.movingTypingText="//button[normalize-space()='>>']"; | |||||
this.replaceMovedText="//button[normalize-space()='<<']"; | |||||
this.saveButton="//button[@id='oba_appconfig_save']"; | |||||
this.merchantCode="//a[normalize-space()='919480707707']"; | |||||
this.calltoactionAPI="#oba_appconfig_call_to_action"; | |||||
this.currencyAPI="#oba_appconfig_select_currency"; | |||||
this.notificationSoundLoopAPI="#oba_notification_sound_loop"; | |||||
this.cancellationTillAPI="#oba_cancellation_till"; | |||||
this.minimumCartPrizeAPI="//label[@id='oba_appconfig_minimum_cart_price_label']//input[@id='oba_appconfig_minimum_cart_price']"; | |||||
this.deliveryChargeAPI="//label[@id='oba_appconfig_delivery_charge_label']//input[@id='oba_appconfig_minimum_cart_price']"; | |||||
this.areaTypeAPI="#oba_appconfig_city_selection_list"; | |||||
} | |||||
async openAppConf(){ | |||||
await this.page.locator(this.appConfLink).click(); | |||||
} | |||||
async selectCurrency(currency){ | |||||
await this.page.locator(this.currency).selectOption({label:currency}); | |||||
} | |||||
async callToAction(Number){ | |||||
await this.page.locator(this.callToAction).fill(Number); | |||||
} | |||||
async areaSelectionTest(area){ | |||||
await this.page.locator(this.appConfLink).click(); | |||||
await this.page.locator(this.areaSelection).selectOption({label:area}); | |||||
} | |||||
async functionalityAppConfig(currency, notificationLoop, cancellationtill, minValue, charge, Number, input, text){ | |||||
await this.page.locator(this.appConfLink).click(); | |||||
await this.page.locator(this.onOffButton).click(); | |||||
await this.page.locator(this.currency).selectOption({label:currency}); | |||||
await this.page.locator(this.notificationSoundLoop).fill(notificationLoop); | |||||
await this.page.locator(this.cancellationTill).fill(cancellationtill); | |||||
await this.page.locator(this.minimumCartPrize).fill(minValue); | |||||
await this.page.locator(this.deliveryCharge).fill(charge); | |||||
await this.page.locator(this.callToAction).fill(Number); | |||||
await this.page.locator(this.areaSelection).click(); | |||||
await this.page.waitForTimeout(5000); | |||||
await this.page.locator(this.areaSelection).selectOption({label:input}); | |||||
await this.page.locator(this.typingText).fill(text); | |||||
await this.page.waitForTimeout(5000); | |||||
await this.page.locator(this.movingTypingText).click(); | |||||
await this.page.locator(this.saveButton).click(); | |||||
} | |||||
async toggleButton() | |||||
{ | |||||
await this.page.locator(this.appConfLink).click(); | |||||
await this.page.locator(this.onOffButton).click(); | |||||
} | |||||
} |
@ -0,0 +1,168 @@ | |||||
exports.CatlogPage= | |||||
class CatlogPage { | |||||
constructor(page) { | |||||
this.page = page; | |||||
this.catlogButton="//span[normalize-space()='Catlog']"; | |||||
this.catalogViewType="//select[@id='oba_bud_view']"; | |||||
this.productsViewType="//select[@id='oba_product_view']"; | |||||
this.categoryImage="#edit_image"; | |||||
this.uploadImage="#oba_product_input_display"; | |||||
this.saveButton="//button[@class='btn btn-primary btn-block']"; | |||||
this.womenSelection="//a[@id='670767f7272db54e96e423e6_anchor']"; | |||||
this.menSelection="//a[@id='670767e7272db54e96e423e5_anchor']"; | |||||
this.kidsSelection="//a[@id='670767fd272db54e96e423e7_anchor']"; | |||||
this.catlogPageValidate="//h3[normalize-space()='Category Tree']"; | |||||
//API Testing | |||||
this.saveButtonAPI="//button[@class='btn btn-primary btn-block']"; | |||||
this.childViewBUDS=""; | |||||
this.womenNameAPI="//input[@id='oba_bud_name']"; | |||||
//Mens API Test | |||||
this.mens = "//a[@id='670767e7272db54e96e423e5_anchor']"; | |||||
this.catname ="//*[@id='oba_bud_name']"; | |||||
this.merchantid ="header[class='app-header'] li:nth-child(3) a:nth-child(1)"; | |||||
//cattlog and products xpaths | |||||
this.catname ="//*[@id='oba_bud_name']"; | |||||
this.catlogViewType ="//select[@id='oba_bud_view']"; | |||||
this.productViewtype ="//select[@id='oba_product_view']"; | |||||
this.categoryImage ="//img[@id='oba_product_display_image']"; | |||||
this.cateforyImageEdit ="//*[name()='path' and contains(@d,'M186.67-18')]"; | |||||
this.postion ="//input[@id='oba_bud_position']"; | |||||
this.islive ="//span[normalize-space()='Yes']"; | |||||
this.productincluded ="//select[@id='oba_bud_final_products']"; | |||||
//catlog creation xpaths | |||||
this.createcat ="//input[@id='oba_bud_child_name']"; | |||||
this.women ="//a[@id='670767f7272db54e96e423e6_anchor']"; | |||||
this.kids = "//a[@id='670767fd272db54e96e423e7_anchor']"; | |||||
this.tree ="//div[@class='col-4']//div[@class='tile']"; | |||||
} | |||||
async clickCatalogButton(){ | |||||
await this.page.locator(this.catlogButton).click(); | |||||
} | |||||
async clickCatalogViewType(catlogView){ | |||||
await this.page.locator(this.catlogButton).click(); | |||||
await this.page.locator(this.catalogViewType).selectOption({label:catlogView}); | |||||
} | |||||
async clickProductViewType(catlogView, productView ){ | |||||
await this.page.locator(this.catlogButton).click(); | |||||
await this.page.locator(this.catalogViewType).selectOption({label:catlogView}); | |||||
await this.page.locator(this.productsViewType).selectOption({label:productView}); | |||||
} | |||||
async imageUpload(catlogView, productView ){ | |||||
await this.page.locator(this.catlogButton).click(); | |||||
await this.page.locator(this.catalogViewType).selectOption({label:catlogView}); | |||||
await this.page.locator(this.productsViewType).selectOption({label:productView}); | |||||
await this.page.locator(this.categoryImage).click(); | |||||
await this.page.locator(this.uploadImage).setInputFiles("C:/Automate Testing/OBA Automation/Biriyani.jpg"); | |||||
await this.page.locator(this.saveButton).click(); | |||||
} | |||||
async imageUpload(catlogView, productView ){ | |||||
await this.page.locator(this.catlogButton).click(); | |||||
await this.page.locator(this.catalogViewType).selectOption({label:catlogView}); | |||||
await this.page.locator(this.productsViewType).selectOption({label:productView}); | |||||
await this.page.locator(this.categoryImage).click(); | |||||
await this.page.locator(this.uploadImage).setInputFiles("C:/Automate Testing/OBA Automation/Biriyani.jpg"); | |||||
await this.page.locator(this.saveButton).click(); | |||||
} | |||||
async NavigateToMens(){ | |||||
await this.page.locator(this.mens).waitFor({ state: 'visible' }); | |||||
await this.page.locator(this.mens).click(); | |||||
let catnames = await this.page.locator(this.catname).getAttribute('value'); | |||||
let merchatcode = await this.page.locator(this.merchantid).textContent(); | |||||
let CatType =await this.page.locator(this.catlogViewType); | |||||
await this.page.locator(this.catname).waitFor({ state: 'visible' }); | |||||
await this.page.locator(this.catlogViewType).waitFor({ state: 'visible' }); | |||||
await this.page.locator(this.productViewtype).waitFor({ state: 'visible' }); | |||||
const selecteddcattype = await CatType.evaluate((element) => { | |||||
return element.options[element.selectedIndex].value; | |||||
}); | |||||
let Prodtype =await this.page.locator(this.productViewtype); | |||||
const selecctedprodtype = await Prodtype.evaluate((element) => { | |||||
return element.options[element.selectedIndex].value; | |||||
}); | |||||
let isActive = await this.page.locator(this.islive).isChecked(); | |||||
return{catnames,selecteddcattype,selecctedprodtype,isActive,merchatcode} | |||||
} | |||||
async NavigateToWomens(){ | |||||
await this.page.locator(this.women).waitFor({ state: 'visible' }); | |||||
await this.page.locator(this.women).click(); | |||||
let merchatcode = await this.page.locator(this.merchantid).textContent(); | |||||
await this.page.locator(this.catname).waitFor({ state: 'visible' }); | |||||
await this.page.locator(this.catlogViewType).waitFor({ state: 'visible' }); | |||||
await this.page.locator(this.productViewtype).waitFor({ state: 'visible' }); | |||||
let catnames = await this.page.locator(this.catname).getAttribute('value'); | |||||
let CatType =await this.page.locator(this.catlogViewType); | |||||
const selecteddcattype = await CatType.evaluate((element) => { | |||||
return element.options[element.selectedIndex].value; | |||||
}); | |||||
let Prodtype =await this.page.locator(this.productViewtype); | |||||
const selecctedprodtype = await Prodtype.evaluate((element) => { | |||||
return element.options[element.selectedIndex].value; | |||||
}); | |||||
let isActive = await this.page.locator(this.islive).isChecked(); | |||||
return{ catnames,selecteddcattype,selecctedprodtype,isActive,merchatcode} | |||||
} | |||||
async NavigateToKids(){ | |||||
await this.page.locator(this.kids).waitFor({ state: 'visible' }); | |||||
await this.page.locator(this.kids).click(); | |||||
let merchatcode = await this.page.locator(this.merchantid).textContent(); | |||||
await this.page.locator(this.catname).waitFor({ state: 'visible' }); | |||||
await this.page.locator(this.catlogViewType).waitFor({ state: 'visible' }); | |||||
await this.page.locator(this.productViewtype).waitFor({ state: 'visible' }); | |||||
let catnames = await this.page.locator(this.catname).getAttribute('value'); | |||||
let CatType =await this.page.locator(this.catlogViewType); | |||||
const selecteddcattype = await CatType.evaluate((element) => { | |||||
return element.options[element.selectedIndex].value; | |||||
}); | |||||
let Prodtype =await this.page.locator(this.productViewtype); | |||||
const selecctedprodtype = await Prodtype.evaluate((element) => { | |||||
return element.options[element.selectedIndex].value; | |||||
}); | |||||
let isActive = await this.page.locator(this.islive).isChecked(); | |||||
return{ catnames,selecteddcattype,selecctedprodtype,isActive,merchatcode} | |||||
} | |||||
async womenAPISelection(){ | |||||
await this.page.locator(this.catlogButton).click(); | |||||
await this.page.locator(this.womenSelection).click(); | |||||
await this.page.locator(this.saveButtonAPI).click(); | |||||
} | |||||
} | |||||
@ -0,0 +1,30 @@ | |||||
exports.ContentPage= | |||||
class ContentPage { | |||||
constructor(page) { | |||||
this.page = page; | |||||
this.contentButton="//span[normalize-space()='Content']"; | |||||
this.contentToEdit="//select[@id='select_content_to_edit']"; | |||||
this.contentPageValidate="//h1[normalize-space()='Content Editor']"; | |||||
this.contentText="//div[@class='CodeMirror-scroll']"; | |||||
this.contentSave="//button[normalize-space()='Save']"; | |||||
} | |||||
async clickContentButton(){ | |||||
await this.page.locator(this.contentButton).click(); | |||||
} | |||||
async ContentToSave(contentToEditOption){ | |||||
await this.page.locator(this.contentButton).click(); | |||||
await this.page.locator(this.contentToEdit).selectOption({label:contentToEditOption}); | |||||
await this.page.waitForSelector('.CodeMirror'); | |||||
await this.page.evaluate(() => { | |||||
const codeMirrorElement = document.querySelector('.CodeMirror'); | |||||
codeMirrorElement.CodeMirror.setValue('Everything goes good'); | |||||
}); | |||||
await this.page.locator(this.contentSave).click(); | |||||
} | |||||
} |
@ -0,0 +1,59 @@ | |||||
exports.CouponPage= | |||||
class CouponPage { | |||||
constructor(page) { | |||||
this.page = page; | |||||
this.couponButton="//span[normalize-space()='Coupon']"; | |||||
this.createCouponButton="//a[normalize-space()='Create coupon']"; | |||||
this.viewCouponButton="//a[normalize-space()='View coupon']"; | |||||
this.selectDiscountRule="//select[@id='oba_coupon_criteria']"; | |||||
this.discountType="//select[@id='oba_coupon_discount_type']"; | |||||
this.minCartAmount="//input[@id='coupon_dicsount_cart_amount']"; | |||||
this.enterDiscountAmount="//input[@id='coupon_discount']"; | |||||
this.calenderSelect="//input[@id='valid_from']"; | |||||
this.validFromDate="//input[@id='valid_from']"; | |||||
this.validFromMonth="//input[@id='valid_from']"; | |||||
this.shortDescription="(//td[contains(text(),'50%OFF')])[2]"; | |||||
this.descriptionCheck="//td[normalize-space()='Happy Pongal !']"; | |||||
this.internalCouponValue="//td[normalize-space()='8SHF21213']"; | |||||
this.couponCode="//td[normalize-space()='Pongal20']"; | |||||
this.forUsers="(//td[contains(text(),'individual_users')])[3]"; | |||||
this.shortDescriptionGuest="//td[normalize-space()='15% Offer']"; | |||||
this.descriptionCheckGuest="//td[normalize-space()='Happy Christmass Makkalae']"; | |||||
this.internalCouponValueGuest="//td[normalize-space()='dFkhI6142']"; | |||||
this.couponCodeGuest="//td[normalize-space()='Christmas30']"; | |||||
this.forUsersGuest="//tbody/tr[6]/td[5]"; | |||||
} | |||||
async CalenderCheck(){ | |||||
await this.page.locator(this.couponButton).click(); | |||||
await this.page.locator(this.createCouponButton).click(); | |||||
await this.page.locator(this.calenderSelect).click(); | |||||
const year ="2024"; | |||||
const month ="11"; | |||||
const date="3"; | |||||
await this.page.locator(this.validFromDate).fill('11/12/2024'); | |||||
} | |||||
async viewCoupon(){ | |||||
await this.page.locator(this.couponButton).click(); | |||||
await this.page.locator(this.viewCouponButton).click(); | |||||
} | |||||
} |
@ -0,0 +1,21 @@ | |||||
exports.Feedback= | |||||
class Feedback { | |||||
constructor(page) { | |||||
this.page = page; | |||||
this.selectFeedbackType="//span[@class='flip-indecator']"; | |||||
this.searchFeedback="//input[@id='oba_feedback_search']"; | |||||
this.searchButton="//i[@class='fa fa-lg fa-fw fa-search']"; | |||||
this.feedbackButton="//span[normalize-space()='Feedback']"; | |||||
this.mailID="//td[normalize-space()='King@gmail.com']"; | |||||
this.feedbackText="//td[normalize-space()='Trial Version']"; | |||||
this.name="//td[normalize-space()='kalki']"; | |||||
this.phone="//td[normalize-space()='919480111111']"; | |||||
} | |||||
async clickFeedbackButton(){ | |||||
await this.page.locator(this.feedbackButton).click(); | |||||
} | |||||
} |
@ -0,0 +1,52 @@ | |||||
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(); | |||||
} | |||||
} | |||||
@ -0,0 +1,382 @@ | |||||
const { clear } = require("console"); | |||||
exports.NotificationPage= | |||||
class NotificationPage { | |||||
constructor(page) | |||||
{ | |||||
this.page = page; | |||||
this.NotifyButton = "//span[normalize-space()='Notification']"; //button | |||||
this.selecttype = "//select[@id='notification_target']"; | |||||
this.Area ="//select[@id='oba_notification_user_type']"; | |||||
this.title = "//input[@id='notificationtitle']"; | |||||
this.content ="//textarea[@id='notificationtext']"; | |||||
this.UserName = "//select[@id='oba_notification_user_fcm_token']"; | |||||
//Notification Buttons: | |||||
this.Send = "//button[2]"; | |||||
this.scheduleNotificationButton ="//main[@class='app-content']//button[1]"; | |||||
//Calendar path's | |||||
this.calendar ="//input[@id='notification_date']"; | |||||
this.Monthlist ="#table[class=' table-condensed'] th[class='datepicker-switch']"; | |||||
this.NextButton ="//div[@class='datepicker-days']//th[@class='next'][normalize-space()='»']"; | |||||
this.year ="(//th[@class='datepicker-switch'])[2]"; | |||||
this.month ="(//th[@class='datepicker-switch'])[1]"; | |||||
this.day ="//td[@class ='day']"; | |||||
//Setting Time | |||||
this.hours ="//select[@id='notification_hours']"; | |||||
this.mins ="//select[@id='notification_minutes']"; | |||||
this.notificationButtonCheck="//span[normalize-space()='Notification']"; | |||||
//File upload | |||||
this.chooseFile ="//input[@id='notificationimage']"; | |||||
} | |||||
//Check notification page | |||||
async notificationPageCheck(){ | |||||
await this.page.locator(this.notificationButtonCheck).click(); | |||||
} | |||||
//Send notification based on the user name | |||||
async NotifyMeWithName(SelectType,TitleName,UserName,TextArea){ | |||||
await this.page.locator(this.NotifyButton).click(); | |||||
await this.page.locator(this.selecttype).selectOption(SelectType); | |||||
await this.page.locator(this.title).fill(TitleName); | |||||
await this.page.locator(this.UserName).selectOption(UserName); | |||||
await this.page.locator( this.content).fill(TextArea); | |||||
} | |||||
async wholeNotificationSetting(SelectType,TitleName,UserName,TextArea,year,month,day,filePath,Hour, Min,){ | |||||
await this.page.locator(this.NotifyButton).click(); | |||||
await this.page.locator(this.selecttype).selectOption(SelectType); | |||||
await this.page.locator(this.title).fill(TitleName); | |||||
await this.page.locator(this.UserName).selectOption(UserName); | |||||
await this.page.locator( this.content).fill(TextArea); | |||||
await this.page.locator(this.calendar).click(); | |||||
// Wait for year selection | |||||
while (true) | |||||
{ | |||||
const currentYear = await this.page.locator(this.year).textContent(); | |||||
if (currentYear == year) | |||||
{ | |||||
break; | |||||
} | |||||
await this.page.locator(this.NextButton).click(); | |||||
} | |||||
// Wait for month selection | |||||
while(true) | |||||
{ | |||||
const monthText = await this.page.locator(this.month).textContent(); | |||||
if (monthText == month ) | |||||
{ | |||||
break; | |||||
} | |||||
await this.page.locator(this.NextButton).click(); | |||||
} | |||||
// Select day | |||||
const dayList = await this.page.locator(this.day).all(); | |||||
for (const dayItem of dayList) | |||||
{ | |||||
try{ | |||||
const dayText = await dayItem.textContent(); | |||||
if(dayText == day) | |||||
{ | |||||
await dayItem.click(); | |||||
console.log('Year is Selected as :' + year); | |||||
console.log('Month is Selected as :' + month); | |||||
console.log('Day is Selected as :' + day); | |||||
} | |||||
} catch (error){ | |||||
console.error('Error waiting for locator:', error); | |||||
} | |||||
} | |||||
try { | |||||
await this.page.locator(this.NotifyButton).click(); | |||||
await this.page.locator(this.chooseFile).setInputFiles(filePath); | |||||
console.log('Attached is :' + filePath); | |||||
await this.page.waitForTimeout(1000); | |||||
} | |||||
catch (error) { | |||||
console.error('File upload failed:', error); | |||||
} | |||||
try { | |||||
await this.page.locator(this.hours).selectOption(Hour); | |||||
console.log('Selected Hour is'+Hour); | |||||
await this.page.locator(this.mins).selectOption(Min); | |||||
console.log('Selected Min is:' +Min); | |||||
} catch (error) { | |||||
console.error('Setting Time Failed', error); | |||||
} | |||||
//await this.page.locator(this.scheduleNotificationButton).click(); | |||||
await this.page.locator(this.scheduleNotificationButton).waitFor({ state: 'visible' }); | |||||
await this.page.locator(this.scheduleNotificationButton).click(); | |||||
} | |||||
//to add file in the notification page. | |||||
async selectFile(filePath) { | |||||
try { | |||||
await this.page.locator(this.NotifyButton).click(); | |||||
await this.page.locator(this.chooseFile).setInputFiles(filePath); | |||||
console.log('Attached is :' + filePath); | |||||
await this.page.waitForTimeout(1000); } | |||||
catch (error) { | |||||
console.error('File upload failed:', error); | |||||
} | |||||
} | |||||
//to set time for the send notification time. | |||||
async setTime(Hour, Min) | |||||
{ | |||||
try { | |||||
await this.page.locator(this.hours).selectOption(Hour); | |||||
console.log('Selected Hour is'+Hour); | |||||
await this.page.locator(this.mins).selectOption(Min); | |||||
console.log('Selected Min is:' +Min); | |||||
} catch (error) { | |||||
console.error('Setting Time Failed', error); | |||||
} | |||||
} | |||||
//send notification based on the area | |||||
async NotifyMewithArea(SelectType,TitleName,Area,TextArea){ | |||||
await this.page.locator(this.NotifyButton).click(); | |||||
await this.page.locator(this.selecttype).selectOption(SelectType); | |||||
await this.page.locator(this.title).fill(TitleName); | |||||
await this.page.locator(this.Area).selectOption(Area); | |||||
await this.page.locator( this.content).fill(TextArea); | |||||
} | |||||
//this method is used to set a date as per req | |||||
async setDate(year,month,day) | |||||
{ | |||||
await this.page.locator(this.NotifyButton).click(); | |||||
await this.page.locator(this.calendar).click(); | |||||
// Wait for year selection | |||||
while (true) | |||||
{ | |||||
const currentYear = await this.page.locator(this.year).textContent(); | |||||
if (currentYear == year) | |||||
{ | |||||
break; | |||||
} | |||||
await this.page.locator(this.NextButton).click(); | |||||
} | |||||
// Wait for month selection | |||||
while(true) | |||||
{ | |||||
const monthText = await this.page.locator(this.month).textContent(); | |||||
if (monthText == month ) | |||||
{ | |||||
break; | |||||
} | |||||
await this.page.locator(this.NextButton).click(); | |||||
} | |||||
// Select day | |||||
const dayList = await this.page.locator(this.day).all(); | |||||
for (const dayItem of dayList) | |||||
{ | |||||
try{ | |||||
const dayText = await dayItem.textContent(); | |||||
if(dayText == day) | |||||
{ | |||||
await dayItem.click(); | |||||
console.log('Year is Selected as :' + year); | |||||
console.log('Month is Selected as :' + month); | |||||
console.log('Day is Selected as :' + day); | |||||
} | |||||
} catch (error){ | |||||
console.error('Error waiting for locator:', error); | |||||
} | |||||
} | |||||
} | |||||
//to add file in the notification page. | |||||
async selectFile(filePath) { | |||||
try { | |||||
await this.page.locator(this.NotifyButton).click(); | |||||
await this.page.locator(this.chooseFile).setInputFiles(filePath); | |||||
console.log('Attached is :' + filePath); | |||||
await this.page.waitForTimeout(1000); } | |||||
catch (error) { | |||||
console.error('File upload failed:', error); | |||||
} | |||||
} | |||||
//to set time for the send notification time. | |||||
async setTime(Hour, Min) | |||||
{ | |||||
try { | |||||
await this.page.locator(this.hours).selectOption(Hour); | |||||
console.log('Selected Hour is'+Hour); | |||||
await this.page.locator(this.mins).selectOption(Min); | |||||
console.log('Selected Min is:' +Min); | |||||
} catch (error) { | |||||
console.error('Setting Time Failed', error); | |||||
} | |||||
} | |||||
//method for send notification | |||||
async sendNotification(){ | |||||
await this.page.locator(this.Send).click(); | |||||
} | |||||
//method to schedule notification | |||||
async scheduleNotification (){ | |||||
await this.page.locator(this.scheduleNotificationButton).click(); | |||||
} | |||||
//Complelety New for Testing | |||||
async wholeNotificationSettingNew(SelectType,TitleName,UserName,TextArea,year,month,day,filePath,Hour, Min,){ | |||||
try { | |||||
// Click Notify Button | |||||
await this.page.locator(this.NotifyButton).click(); | |||||
// Fill in Notification Details | |||||
await this.page.locator(this.selecttype).selectOption(SelectType); | |||||
await this.page.locator(this.title).fill(TitleName); | |||||
await this.page.locator(this.UserName).selectOption(UserName); | |||||
await this.page.locator(this.content).fill(TextArea); | |||||
// Select Date | |||||
await this.page.locator(this.calendar).click(); | |||||
// Select Year | |||||
let yearAttempts = 0; | |||||
while (true) { | |||||
const currentYear = await this.page.locator(this.year).textContent(); | |||||
if (currentYear == year) break; | |||||
await this.page.locator(this.NextButton).click(); | |||||
yearAttempts++; | |||||
if (yearAttempts > 20) throw new Error('Year selection failed after multiple attempts.'); | |||||
} | |||||
// Select Month | |||||
let monthAttempts = 0; | |||||
while (true) { | |||||
const monthText = await this.page.locator(this.month).textContent(); | |||||
if (monthText == month) break; | |||||
await this.page.locator(this.NextButton).click(); | |||||
monthAttempts++; | |||||
if (monthAttempts > 12) throw new Error('Month selection failed after multiple attempts.'); | |||||
} | |||||
// Select Day | |||||
const dayList = await this.page.locator(this.day).all(); | |||||
let dayFound = false; | |||||
for (const dayItem of dayList) { | |||||
const dayText = await dayItem.textContent(); | |||||
if (dayText == day) { | |||||
await dayItem.click(); | |||||
dayFound = true; | |||||
console.log(`Selected Date: ${day}-${month}-${year}`); | |||||
break; | |||||
} | |||||
} | |||||
if (!dayFound) throw new Error('Day selection failed.'); | |||||
// Schedule Notification | |||||
await this.page.locator(this.scheduleNotificationButton).waitFor({ state: 'visible' }); | |||||
await this.page.locator(this.scheduleNotificationButton).click(); | |||||
console.log('Notification scheduled successfully!'); | |||||
} catch (error) { | |||||
console.error('Error in wholeNotificationSetting:', error); | |||||
// Optional: Take a screenshot for debugging | |||||
await this.page.screenshot({ path: 'error-screenshot.png' }); | |||||
throw error; // Re-throw to propagate error | |||||
} | |||||
} | |||||
//set file | |||||
async selectFile(filePath) { | |||||
try { | |||||
await this.page.locator(this.NotifyButton).click(); | |||||
await this.page.locator(this.chooseFile).setInputFiles(filePath); | |||||
console.log('Attached file:', filePath); | |||||
} catch (error) { | |||||
console.error('File upload failed:', error); | |||||
} | |||||
} | |||||
//set time | |||||
async setTime(Hour, Min) { | |||||
try { | |||||
await this.page.locator(this.hours).selectOption(Hour); | |||||
console.log('Selected Hour:', Hour); | |||||
await this.page.locator(this.mins).selectOption(Min); | |||||
console.log('Selected Minute:', Min); | |||||
} catch (error) { | |||||
console.error('Setting Time Failed:', error); | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,113 @@ | |||||
exports.OrderPage = | |||||
class OrderPage { | |||||
constructor(page) { | |||||
this.page = page; | |||||
this.ordersButton="//span[normalize-space()='Orders']"; | |||||
this.ordersListButton="//a[normalize-space()='Order List']"; | |||||
this.exportButton="//a[@class='treeview-item active']"; | |||||
this.orderStatus="//select[@id='oba_edit_order_status_filter']"; | |||||
this.usernameTextbox="//input[@id='oba_order_search']"; | |||||
this.textBox="//input[@id='oba_order_search']"; | |||||
this.filterButton="#oba_edit_order_filter"; | |||||
this.orderName="//div[normalize-space()='Name : Shubya']"; | |||||
this.orderEmail="//div[normalize-space()='Email : Shubya111@gmail.com']"; | |||||
this.orderPhone="//div[normalize-space()='Phone : 919480111222']"; | |||||
this.orderCost="//td[normalize-space()='200']"; | |||||
this.orderQty="//tbody/tr[1]/td[6]"; | |||||
this.orderAddressAPI="//div[normalize-space()='Address : 37, Thomas Mount, 627109']"; | |||||
//orderidfor cancel | |||||
this.orderIdCancel="//div[normalize-space()='order_id : 670e240e14f563f755f3e2a4']"; | |||||
//Order list XPaths to crooss check | |||||
this.orderdetails1 ="//table[@class='table table-sm']"; // order id,name,email,phone | |||||
this.OrderStatuses ="//tbody//tr//td[3]"; //order status | |||||
this.Ordercost ="//tbody//tr//td[2]"; //order cost | |||||
this.OrderItems ="//tbody//tr//td[5]"; //order items | |||||
this.OrderPrice ="//tbody//tr//td[7]"; //order price | |||||
this.OrderPaymentStatus ="tbody tr td:nth-child(10)"; //order payment status | |||||
this.orderlatestUpdate ="//tbody//tr//td[9]"; //order latest update | |||||
this.Order_qty = "//tbody//tr//td[6]"; //order qty | |||||
//OrderID Check xpath | |||||
this.userid="//div[normalize-space()='order_id : 670e249314f563f755f3e2a5']"; | |||||
this.username="//div[normalize-space()='Name : DAYA']"; | |||||
this.useremail="//div[normalize-space()='Email : Daya1234@gmail.com']"; | |||||
this.userphone="//div[normalize-space()='Phone : 919480111111']"; | |||||
this.userorderitems="//td[normalize-space()='T-Shirt']"; | |||||
this.ordercost="//td[normalize-space()='604']"; | |||||
this.orderqty="//td[normalize-space()='3']"; | |||||
this.userorderstatus="//strong[normalize-space()='ORDER_STATUS_PENDING']"; | |||||
//Order Rate Api | |||||
this.orderID="//div[normalize-space()='order_id : 67076b44272db54e96e423eb']"; | |||||
this.orderRate="//tbody/tr[3]/td[8]"; | |||||
} | |||||
//Click Order button | |||||
async clickOrdersButton(){ | |||||
await this.page.locator(this.ordersButton).click(); | |||||
} | |||||
//Click order list button | |||||
async clickOrdersListButton(){ | |||||
await this.page.locator(this.ordersButton).click(); | |||||
await this.page.locator(this.ordersListButton).click(); | |||||
} | |||||
//Check order status | |||||
async orderStatusCheck(orderStatus){ | |||||
await this.page.locator(this.ordersButton).click(); | |||||
await this.page.locator(this.ordersListButton).click(); | |||||
await this.page.locator(this.orderStatus).selectOption({label:orderStatus}); | |||||
} | |||||
//Check filter button | |||||
async checkFilterButton(orderStatus){ | |||||
await this.page.locator(this.ordersButton).click(); | |||||
await this.page.locator(this.ordersListButton).click(); | |||||
await this.page.locator(this.orderStatus).selectOption({label:orderStatus}); | |||||
await this.page.locator(this.filterButton).click(); | |||||
} | |||||
//Search text | |||||
async textBoxSearch(orderStatus, textBox){ | |||||
await this.page.locator(this.ordersButton).click(); | |||||
await this.page.locator(this.ordersListButton).click(); | |||||
await this.page.locator(this.orderStatus).selectOption({label:orderStatus}); | |||||
await this.page.locator(this.textBox).fill(textBox); | |||||
await this.page.locator(this.filterButton).click(); | |||||
} | |||||
//search order | |||||
async searchOrder(orderStatus,username){ | |||||
await this.page.locator(this.OrderStatus).selectOption(orderStatus); // add order status | |||||
await this.page.locator(this.usernameTextbox).fill(username); // add user name | |||||
await this.page.locator(this.filterButton).click(); //click filter button | |||||
const OrderId = await this.page.locator(this.orderdetails1).textContent(); // get order id | |||||
const OrderStatusis = await this.page.locator(this.OrderStatuses).textContent(); // get order status | |||||
const Order_cost = await this.page.locator(this.Ordercost).textContent(); // get order cost | |||||
const Order_items = await this.page.locator(this.OrderItems).textContent(); // get order items | |||||
const Order_price =await this.page.locator(this.OrderPrice ).textContent(); // get order price | |||||
const Order_payment =await this.page.locator(this.OrderPaymentStatus).textContent(); // get order payment status | |||||
const Order_latestupdate =await this.page.locator(this.orderlatestUpdate).textContent(); //get oder latest update | |||||
var Order_qty =await this.page.locator(this.Order_qty).textContent(); // get order quanity | |||||
return {OrderId,OrderStatusis,Order_cost,Order_items,Order_price,Order_payment,Order_latestupdate,Order_qty} | |||||
} | |||||
} | |||||
@ -0,0 +1,217 @@ | |||||
exports.ProductPage= | |||||
class ProductPage { | |||||
constructor(page) { | |||||
this.page = page; | |||||
//Locators for Product Page | |||||
this.productsButton = "//span[normalize-space()='Products']"; | |||||
this.productListButton= "//a[normalize-space()='Product List']"; | |||||
this.addProductButton="//a[normalize-space()='Add Product']"; | |||||
this.productName="//input[@id='oba_product_name']"; | |||||
this.productPrize="//input[@id='oba_product_price']"; | |||||
this.managedRadioButton="//input[@id='managed']"; | |||||
this.unmanagedRadioButton="//input[@id='unmanaged']"; | |||||
this.productQuantityValue="//input[@id='oba_product_quantity']"; | |||||
this.orderLimit="//input[@id='oba_product_order_limit']"; | |||||
this.taxIn="//input[@id='oba_product_tax']"; | |||||
this.productAvailableCheck="//input[@name='isAvailable']"; | |||||
this.isLiveCheck="//input[@name='isLive']"; | |||||
this.shortDescription="//textarea[@id='oba_product_short_description']"; | |||||
this.productDescription="//textarea[@name='editor-html-code']"; | |||||
this.productImage="#edit_image"; | |||||
this.uploadImage="#oba_product_input_display"; | |||||
this.productlistSearchBox="//input[@id='oba_product_search']"; | |||||
this.searchBox="//i[@class='fa fa-lg fa-fw fa-search']"; | |||||
this.editButton="//i[@class='fa fa-lg fa-edit']"; | |||||
this.edittButton="//a[@class='btn btn-primary']"; | |||||
this.saveButton="//button[@class='btn btn-primary btn-block']"; | |||||
this.deleteButton="//i[@class='fa fa-lg fa-trash']"; | |||||
this.searchProduct="//input[@id='oba_product_search']"; | |||||
this.searchButton="//button[@id='oba_product_search_btn']"; | |||||
//API Validation | |||||
this.nameAPI="//td[normalize-space()='T-Shirt']"; | |||||
this.priceAPI="//b[normalize-space()='200']"; | |||||
this.quantityAPI="//td[normalize-space()='79971']"; | |||||
this.availableAPI="//td[normalize-space()='true']"; | |||||
this.orderlimitAPI="//td[normalize-space()='100']"; | |||||
//Delete the Product from product list after assertion | |||||
this.editButtonAssertion="//tbody/tr[2]/td[7]/div[1]/a[1]"; | |||||
this.deleteButtonAssertion="(//a[@class='btn btn-primary'])[2]"; | |||||
this.deleteitAssertion="//button[@class='swal2-confirm swal2-styled']"; | |||||
} | |||||
// Check Product button | |||||
async clickProductsButton(){ | |||||
await this.page.locator(this.productsButton).click(); | |||||
} | |||||
//Check ProductListButton | |||||
async clickProductlistButton(){ | |||||
await this.page.locator(this.productsButton).click(); | |||||
await this.page.locator(this.productListButton).click(); | |||||
} | |||||
//Check Add Product Button | |||||
async clickAddProductButton(){ | |||||
await this.page.locator(this.productsButton).click(); | |||||
await this.page.locator(this.addProductButton).click(); | |||||
} | |||||
//Complete Add Product Functionality | |||||
async addProductFunctionality(productName, productPrize, productQuantity, orderLimitvalue, taxin, shortDescription){ | |||||
await this.page.locator(this.productsButton).click(); | |||||
await this.page.locator(this.addProductButton).click(); | |||||
await this.page.locator(this.productName).fill(productName); | |||||
await this.page.locator(this.productPrize).fill(productPrize); | |||||
await this.page.locator(this.managedRadioButton).check(); | |||||
await this.page.locator(this.productQuantityValue).fill(productQuantity); | |||||
await this.page.locator(this.orderLimit).fill(orderLimitvalue); | |||||
await this.page.locator(this.taxIn).fill(taxin); | |||||
await this.page.locator(this.productAvailableCheck).check(); | |||||
await this.page.locator(this.isLiveCheck).check(); | |||||
await this.page.locator(this.shortDescription).fill(shortDescription); | |||||
await this.page.waitForSelector('.CodeMirror'); | |||||
await this.page.evaluate(() => { | |||||
const codeMirrorElement = document.querySelector('.CodeMirror'); | |||||
codeMirrorElement.CodeMirror.setValue('Yummy! Delicious Biriyani Taste the Beauty of Kanyakumari'); | |||||
}); | |||||
await this.page.locator(this.productImage).click(); | |||||
await this.page.locator(this.uploadImage).setInputFiles("./pages/TestData/Biriyani.jpg"); | |||||
await this.page.locator(this.saveButton).click(); | |||||
} | |||||
// Add Product functionality and delete it | |||||
async addProductFunctionalityDelete(productName, productPrize, productQuantity, orderLimitvalue, taxin, shortDescription){ | |||||
await this.page.locator(this.productsButton).click(); | |||||
await this.page.locator(this.addProductButton).click(); | |||||
await this.page.locator(this.productName).fill(productName); | |||||
await this.page.locator(this.productPrize).fill(productPrize); | |||||
await this.page.locator(this.managedRadioButton).check(); | |||||
await this.page.locator(this.productQuantityValue).fill(productQuantity); | |||||
await this.page.locator(this.orderLimit).fill(orderLimitvalue); | |||||
await this.page.locator(this.taxIn).fill(taxin); | |||||
await this.page.locator(this.productAvailableCheck).check(); | |||||
await this.page.locator(this.isLiveCheck).check(); | |||||
await this.page.locator(this.shortDescription).fill(shortDescription); | |||||
await this.page.waitForSelector('.CodeMirror'); | |||||
await this.page.evaluate(() => { | |||||
const codeMirrorElement = document.querySelector('.CodeMirror'); | |||||
codeMirrorElement.CodeMirror.setValue('Yummy! Delicious Taste, LifteTime Settlement'); | |||||
}); | |||||
await this.page.locator(this.productImage).click(); | |||||
await this.page.locator(this.uploadImage).setInputFiles("./pages/TestData/Biriyani.jpg"); | |||||
await this.page.locator(this.deleteButton).click(); | |||||
} | |||||
async addProductFunctionalityForAll(productName, productPrize, productQuantity, orderLimitvalue, taxin, shortDescription){ | |||||
await this.page.locator(this.productsButton).click(); | |||||
await this.page.locator(this.addProductButton).click(); | |||||
await this.page.locator(this.productName).fill(productName); | |||||
await this.page.locator(this.productPrize).fill(productPrize); | |||||
await this.page.locator(this.managedRadioButton).check(); | |||||
await this.page.locator(this.productQuantityValue).fill(productQuantity); | |||||
await this.page.locator(this.orderLimit).fill(orderLimitvalue); | |||||
await this.page.locator(this.taxIn).fill(taxin); | |||||
await this.page.locator(this.productAvailableCheck).check(); | |||||
await this.page.locator(this.isLiveCheck).check(); | |||||
await this.page.locator(this.shortDescription).fill(shortDescription); | |||||
await this.page.waitForSelector('.CodeMirror'); | |||||
await this.page.evaluate(() => { | |||||
const codeMirrorElement = document.querySelector('.CodeMirror'); | |||||
codeMirrorElement.CodeMirror.setValue('Yummy! Delicious Taste, LifteTime Settlement'); | |||||
}); | |||||
await this.page.locator(this.saveButton).click(); | |||||
} | |||||
async addProductFunctionalityUnmanaged(productName, productPrize, orderLimitvalue, taxin, shortDescription){ | |||||
await this.page.locator(this.productsButton).click(); | |||||
await this.page.locator(this.addProductButton).click(); | |||||
await this.page.locator(this.productName).fill(productName); | |||||
await this.page.locator(this.productPrize).fill(productPrize); | |||||
await this.page.locator(this.unmanagedRadioButton).check(); | |||||
await this.page.locator(this.orderLimit).fill(orderLimitvalue); | |||||
await this.page.locator(this.taxIn).fill(taxin); | |||||
await this.page.locator(this.shortDescription).fill(shortDescription); | |||||
await this.page.waitForSelector('.CodeMirror'); | |||||
await this.page.evaluate(() => { | |||||
const codeMirrorElement = document.querySelector('.CodeMirror'); | |||||
codeMirrorElement.CodeMirror.setValue('Crispy Chicken Tandori'); | |||||
}); | |||||
await this.page.locator(this.productImage).click(); | |||||
await this.page.locator(this.uploadImage).setInputFiles("./pages/TestData/Tandori.jpg"); | |||||
await this.page.locator(this.saveButton).click(); | |||||
} | |||||
async addProductFunctionality1(productName, productPrize, productQuantity, orderLimitvalue, taxin, shortDescription){ | |||||
await this.page.locator(this.productsButton).click(); | |||||
await this.page.locator(this.addProductButton).click(); | |||||
await this.page.locator(this.productName).fill(productName); | |||||
await this.page.locator(this.productPrize).fill(productPrize); | |||||
await this.page.locator(this.managedRadioButton).check(); | |||||
await this.page.locator(this.productQuantityValue).fill(productQuantity); | |||||
await this.page.locator(this.orderLimit).fill(orderLimitvalue); | |||||
await this.page.locator(this.taxIn).fill(taxin); | |||||
await this.page.locator(this.productAvailableCheck).check(); | |||||
await this.page.locator(this.isLiveCheck).check(); | |||||
await this.page.locator(this.shortDescription).fill(shortDescription); | |||||
await this.page.waitForSelector('.CodeMirror'); | |||||
await this.page.evaluate(() => { | |||||
const codeMirrorElement = document.querySelector('.CodeMirror'); | |||||
codeMirrorElement.CodeMirror.setValue('Yummy! Delicious Taste, LifteTime Settlement'); | |||||
}); | |||||
await this.page.locator(this.productImage).click(); | |||||
await this.page.locator(this.uploadImage).setInputFiles("./pages/TestData/Chicken Lollipop.jpg"); | |||||
await this.page.locator(this.saveButton).click(); | |||||
} | |||||
//Working of Search Product Button | |||||
async searchProductName(productName){ | |||||
await this.page.locator(this.productsButton).click(); | |||||
await this.page.locator(this.productListButton).click(); | |||||
await this.page.locator(this.searchProduct).fill(productName); | |||||
await this.page.locator(this.searchButton).click(); | |||||
} | |||||
//Working of Edit Button | |||||
async editProduct(){ | |||||
await this.page.locator(this.productsButton).click(); | |||||
await this.page.locator(this.productListButton).click(); | |||||
await this.page.locator(this.edittButton).click(); | |||||
await this.page.locator(this.productAvailableCheck).click(); | |||||
await this.page.locator(this.saveButton).click(); | |||||
} | |||||
//delete product after storing | |||||
async deleteProduct(){ | |||||
//Delete the Product from product list after assertion | |||||
await this.page.locator(this.editButtonAssertion).click(); | |||||
await this.page.locator(this.deleteButtonAssertion).click(); | |||||
await this.page.waitForTimeout(5000); | |||||
await this.page.locator(this.deleteitAssertion).click(); | |||||
await this.page.close(); | |||||
} | |||||
} |
@ -0,0 +1,55 @@ | |||||
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(); | |||||
} | |||||
} |
@ -0,0 +1,19 @@ | |||||
exports.RunnerListPage= | |||||
class RunnerListPage { | |||||
constructor(page) { | |||||
this.page = page; | |||||
//LOcators for runner list page | |||||
this.runnerListButton="//span[normalize-space()='Runner list']"; | |||||
this.userTypeFlip="//span[@class='flip-indecator']"; | |||||
this.searchText="//input[@id='oba_user_search']"; | |||||
this.searchButton="//button[@id='oba_user_search_btn']"; | |||||
} | |||||
//Runnerlist Button working? | |||||
async clickrunnerListButton(){ | |||||
await this.page.locator(this.runnerListButton).click(); | |||||
} | |||||
} |
@ -0,0 +1,64 @@ | |||||
exports.UserPage= | |||||
class UserPage { | |||||
constructor(page) { | |||||
this.page = page; | |||||
this.Users = "//span[normalize-space()='Users']"; | |||||
this.activeUserButton = "//span[@class='flip-indecator']"; | |||||
this.searchUser="//input[@id='oba_user_search']"; | |||||
this.enableButton = "//button[@id='66eaa9656b2f4a3d52a42549']"; | |||||
this.filterButton="//button[@id='oba_user_search_btn']"; | |||||
//AssertionForAPI | |||||
this.userNameAPI="//td[normalize-space()='DAYA']"; | |||||
this.userPhoneAPI="//td[normalize-space()='919480111111']"; | |||||
this.userEmailAPI="//td[normalize-space()='Daya1234@gmail.com']"; | |||||
this.merchantCode="//a[normalize-space()='919480707707']"; | |||||
this.addressAPI="//td[normalize-space()='777777,India,chennai']"; | |||||
//Assertion for address | |||||
this.addressList="//td[normalize-space()='35, Mount Main Road , Tamil Nadu, 123111']"; | |||||
this.addressPatch="//td[normalize-space()='35, Mount Kitchen Main Road, Tamil Nadu, 123111']"; | |||||
} | |||||
//UserPage Button Validation | |||||
async userPageButton(){ | |||||
await this.page.locator(this.Users).click(); | |||||
} | |||||
//Validate active user button Check | |||||
async activeUserButtonCheck(){ | |||||
await this.page.locator(this.Users).click(); | |||||
await this.page.locator(this.activeUserButton).click(); | |||||
} | |||||
//Validate SearchUserValidation | |||||
async searchUserValidation(user){ | |||||
await this.page.locator(this.Users).click(); | |||||
await this.page.locator(this.searchUser).fill(user); | |||||
await this.page.locator(this.filterButton).click(); | |||||
} | |||||
//Edit the active user Button | |||||
async activeUserButtonEdit(){ | |||||
await this.page.locator(this.Users).click(); | |||||
await this.page.locator(this.activeUserButton).click(); | |||||
await this.page.locator(this.enableButton).click(); | |||||
} | |||||
//Navigate to user page in API for user details | |||||
async userAPI(){ | |||||
await this.page.locator(this.Users).click(); | |||||
} | |||||
//Navigate to user page in API for address | |||||
async addressListAPI(){ | |||||
await this.page.locator(this.Users).click(); | |||||
} | |||||
} |
@ -0,0 +1,530 @@ | |||||
const {test, expect} =require('@playwright/test') | |||||
import { LoginPage } from '../pages/LoginPage'; | |||||
import { OrderPage } from '../pages/OrderPage'; | |||||
import { AppConfig } from '../pages/AppConfig'; | |||||
import { CouponPage } from '../pages/Couponpage'; | |||||
import { UserPage } from '../pages/UserPage'; | |||||
import { CatlogPage } from '../pages/CatlogPage'; | |||||
import { ProductPage } from '../pages/ProductPage'; | |||||
//dont put commented code in repo | |||||
//its better to give discription for the steps you are following in comments | |||||
//add the ids of manual testcases in test.describe also suggest if the testcase is from regression suit or not and add tags respectively | |||||
const baseURL="https://dev.orderbookings.com/api"; | |||||
// Validate Orders by UserID(In regression suite) | |||||
test('TC_API_01: Validate Get Orders API by User ID)',async ({request,page})=>{ | |||||
// Get Request and store response | |||||
const response = await request.get(baseURL+'/order/syncOrders?user_id=670766e4272db54e96e423e0&phone=919480111222&lastupdatetime=0&merchantCode=919480707707&role=ROLE_TYPE_MERCHANT'); | |||||
const res = await response.json(); | |||||
// Navigate to login page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
// Navigate to order page and search | |||||
const order = new OrderPage(page); | |||||
await order.textBoxSearch('ORDER_STATUS_COMPLETE', 'Shubya'); | |||||
//Assertions | |||||
expect.soft(order.orderName).toContain(res.data[0].ordered_by_name); | |||||
expect.soft(order.orderEmail).toContain(res.data[0].ordered_by_email); | |||||
expect.soft(order.orderPhone).toContain((res.data[0].ordered_by_address.phone).toString()); | |||||
expect.soft(order.orderCost).toContain((res.data[0].order_cost).toString()); | |||||
expect.soft(order.orderQty).toContain((res.data[0].ordered_items_qty[0]).toString()); | |||||
}) | |||||
//Validate App Config Page (In regression suite) | |||||
test('TC-API-11: complete AppConfig page to check API',async ({page,request})=>{ | |||||
// Navigate to login page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
// Navigate to App Config Page | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('UAE dirham (د.إ;)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
//get request and response | |||||
const response = await request.get(baseURL+'/config/919480707707?merchantCode=919480707707'); | |||||
const res = await response.json(); | |||||
//Assertions | |||||
expect.soft(config.merchantCode).toContain(res.data.merchantCode); | |||||
const cancellationTillResponse = await page.locator(config.cancellationTillAPI).inputValue(); | |||||
expect.soft(cancellationTillResponse).toContain((res.data.cancellation_till).toString()); | |||||
const minimumCartPrizeResponse = await page.locator(config.minimumCartPrizeAPI).inputValue(); | |||||
expect.soft( minimumCartPrizeResponse).toContain((res.data.minimum_cart_price).toString()); | |||||
const deliveryChargeResponse = await page.locator(config.deliveryChargeAPI).inputValue(); | |||||
expect.soft( deliveryChargeResponse).toContain((res.data.delivery_charge).toString()); | |||||
}) | |||||
//Validate API Testing to get coupon details as user(In Regression Suite) | |||||
test('TC_API_16: APITesting_Coupon Get Details as User',async ({request,page})=>{ | |||||
//Get request and response | |||||
const response = await request.get(baseURL+'/available-coupon/670e14cf14f563f755f3e2a1/919480707707'); | |||||
const res = await response.json(); | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to coupon page | |||||
const coupon = new CouponPage(page); | |||||
await coupon.viewCoupon(); | |||||
//Assertions | |||||
expect.soft(coupon.shortDescription).toContain(res.data[1].name); | |||||
expect.soft(coupon.descriptionCheck).toContain(res.data[1].description); | |||||
expect.soft(coupon.internalCouponValue).toContain(res.data[1].code); | |||||
expect.soft(coupon.couponCode).toContain(res.data[1].campaign_code); | |||||
}) | |||||
//Validate Coupon details as Guest(In Regression Suite) | |||||
test('TC_API_16: APITesting_Coupon Get Details as Guest',async ({request,page})=>{ | |||||
//get request and response | |||||
const response = await request.get(baseURL+'/available-coupon-guest/919480707707'); | |||||
const res = await response.json(); | |||||
//Navigate to login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to coupon page | |||||
const coupon = new CouponPage(page); | |||||
await coupon.viewCoupon(); | |||||
//Assertions | |||||
expect.soft(coupon.shortDescriptionGuest).toContain(res.data[0].name); | |||||
expect.soft(coupon.descriptionCheckGuest).toContain(res.data[0].description); | |||||
expect.soft(coupon.internalCouponValueGuest).toContain(res.data[0].code); | |||||
expect.soft(coupon.couponCodeGuest).toContain(res.data[0].campaign_code); | |||||
}) | |||||
//get order by order id and compare with web ui in the order list.(In Regression Suite) | |||||
test('TC_API_06: GET ORDER BY ORDER_ID',async ({request,page})=>{ | |||||
//Get request and response | |||||
const response1 = await request.get(baseURL+'/order/getorder/670e249314f563f755f3e2a5'); | |||||
const res = await response1.json(); | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to order page | |||||
const order = new OrderPage(page); | |||||
await order.textBoxSearch('ORDER_STATUS_PENDING', 'DAYA'); | |||||
//Assertions | |||||
expect.soft(order.userid).toContain(res.data.id); //id | |||||
expect.soft(order.username).toContain(res.data.ordered_by_name); //name | |||||
expect.soft(order.useremail).toContain(res.data.ordered_by_email); //email | |||||
expect.soft(order.userphone).toContain(res.data.ordered_by_phone); //phone | |||||
const element = await page.locator(order.userorderitems); | |||||
const text = await element.textContent(); | |||||
expect(text).toContain(res.data.ordered_items[0]); //order items | |||||
expect.soft(order.orderqty).toContain((res.data.ordered_items_qty[0]).toString()); // order qty | |||||
await page.close(); | |||||
}) | |||||
//get order by order id and compare with web ui in the order list.(In Regression Suite) | |||||
test('TC_API_10: GET USER Details',async ({request,page})=>{ | |||||
//Get request and response | |||||
const response2 = await request.get(baseURL+'/user/userreg?phone=919480111111&merchantCode=919480707707'); | |||||
const res = await response2.json(); | |||||
//Navigate to login page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to user page | |||||
const user = new UserPage(page); | |||||
await user.userAPI(); | |||||
//Assertions | |||||
expect.soft(user.userNameAPI).toContain(res.data.name); | |||||
expect.soft(user.userPhoneAPI).toContain(res.data.phone); | |||||
expect.soft(user.userEmailAPI).toContain(res.data.email); | |||||
expect.soft(user.merchantCode).toContain(res.data.merchantCode); | |||||
expect.soft(user.addressAPI).toContain(res.data.area[0]); | |||||
expect.soft(user.addressAPI).toContain(res.data.area[1]); | |||||
expect.soft(user.addressAPI).toContain(res.data.area[2]); | |||||
await page.close(); | |||||
}) | |||||
//Validate Categories(In Regression Suite) | |||||
test('TC-API-12: Get Categories and products',async ({page,request})=>{ | |||||
//Main Page Element locating | |||||
//Get request and response | |||||
const response = await request.get(baseURL+'/bud/919480707707'); | |||||
const res = await response.json(); | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to categories Page | |||||
const catlog = new CatlogPage(page); | |||||
await catlog.clickCatalogButton(); | |||||
//Assertions | |||||
const obaBudView = page.locator('//select[@id="oba_bud_view"]'); | |||||
const obaProductView = page.locator('//select[@id="oba_product_view"]'); | |||||
const budValue = await obaBudView.inputValue(); | |||||
const productValue = await obaProductView.inputValue(); | |||||
expect.soft(budValue).toContain(res.data.buds[0].childview); | |||||
expect.soft(productValue).toContain(res.data.buds[0].product_childview); | |||||
// Mens Page | |||||
//Navigate to Login Page | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to Catlog Page | |||||
await catlog.clickCatalogButton(); | |||||
let Category1 = await catlog.NavigateToMens(); | |||||
//Initialize values | |||||
let Name1 = await Category1.catnames; | |||||
let catlogViewType1 = await Category1.selecteddcattype; | |||||
let Productviewtype1 = await Category1.selecctedprodtype; | |||||
let Catislive1 = await Category1.isActive; | |||||
let merchantid = await Category1.merchatcode; | |||||
let cat1 =res.data.buds[1].name; | |||||
let catlog1ViewType1 =res.data.buds[1].childview; | |||||
let cat1Productviewtype =res.data.buds[1].product_childview; | |||||
let cat1islive = res.data.buds[1].is_live; | |||||
let merchantcode =res.data.buds[1].merchantCode; | |||||
var cat2 = res.data.buds[2].name; //womens | |||||
var cat3 = res.data.buds[3].name; //kids | |||||
//Assertions | |||||
expect.soft(Name1).toEqual(cat1); | |||||
expect.soft(merchantid).toEqual(merchantcode) | |||||
expect.soft(catlogViewType1).toEqual(catlog1ViewType1); | |||||
expect.soft(Productviewtype1).toEqual(cat1Productviewtype); | |||||
expect.soft(Catislive1).toEqual(cat1islive); | |||||
// Womens Page | |||||
//Initialize values | |||||
let Category2 = await catlog.NavigateToWomens(); | |||||
const Name2 = await Category2.catnames; | |||||
const catlogViewType2 = await Category2.selecteddcattype; | |||||
const Productviewtype2 = await Category2.selecctedprodtype; | |||||
const Catislive2 = Category2.isActive; | |||||
let cat2logViewType =res.data.buds[2].childview; | |||||
let cat2Productviewtype =res.data.buds[2].product_childview; | |||||
let cat2islive = res.data.buds[2].is_live; | |||||
let merchantcode2 =res.data.buds[2].merchantCode; | |||||
//Assertions | |||||
expect.soft(Name2).toEqual(cat2); | |||||
expect.soft(merchantid).toEqual(merchantcode2) | |||||
expect.soft(catlogViewType2).toEqual(cat2logViewType); | |||||
expect.soft(Productviewtype2).toEqual(cat2Productviewtype); | |||||
expect.soft(Catislive2).toEqual(cat2islive); | |||||
//this cat3 is kids | |||||
let Category3 = await catlog.NavigateToKids(); | |||||
const Name3 = await Category3.catnames; | |||||
const catlogViewType3 = await Category3.selecteddcattype; | |||||
const Productviewtype3 = await Category3.selecctedprodtype; | |||||
const Catislive3 = Category3.isActive; | |||||
let cat3ogViewType =res.data.buds[3].childview; | |||||
let cat3Productviewtype =res.data.buds[3].product_childview; | |||||
let cat3islive = res.data.buds[3].is_live; | |||||
let merchantcode3 =res.data.buds[3].merchantCode; | |||||
//Assertions | |||||
expect.soft(Name3).toEqual(cat3); | |||||
expect.soft(merchantid).toEqual(merchantcode3); | |||||
expect.soft(catlogViewType3).toEqual(cat3ogViewType); | |||||
expect.soft(Productviewtype3).toEqual(cat3Productviewtype); | |||||
expect.soft(Catislive3).toEqual(cat3islive); | |||||
}) | |||||
//Get products(In regression suite) | |||||
test('TC-API-12: Get Products',async ({request,page})=>{ | |||||
//Get request and response | |||||
const response = await request.get(baseURL+'/bud/919480707707'); | |||||
const res = await response.json(); | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to product page | |||||
const product = new ProductPage(page); | |||||
await product.clickProductlistButton(); | |||||
//Assertions | |||||
const productName = await page.textContent("//td[normalize-space()='T-Shirt']"); | |||||
expect.soft(productName.trim()).toContain(res.data.products[0].name.trim()); | |||||
expect.soft(product.priceAPI).toContain((res.data.products[0].price).toString()); | |||||
expect.soft(product.quantityAPI).toContain((res.data.products[0].quantity).toString()); | |||||
const productBoolean = | |||||
{ | |||||
availableAPI: await page.textContent("//td[normalize-space()='true']") | |||||
}; | |||||
expect.soft(productBoolean.availableAPI.trim()).toBe(String(res.data.products[0].available)); | |||||
expect.soft(product.orderlimitAPI).toContain((res.data.products[0].order_limit).toString()); | |||||
}) | |||||
//Complete address list process(In regression suite) | |||||
test('TC_API-02,03,01,17: Complete Address API',async({page,request})=>{ | |||||
let resourceId; | |||||
// 1. Post Response | |||||
const postResponse = await request.post(baseURL+'/user/addnewaddress',{ | |||||
data: { | |||||
"addressLine1": "35", | |||||
"addressLine2": "Mount Main Road ", | |||||
"city": "Chennai", | |||||
"stateOrProvince": "Tamil Nadu", | |||||
"postalCode": "123111", | |||||
"phone": "919480111111", | |||||
"deliveryInstructions": null, | |||||
"isDefault": true, | |||||
"user_id": "670e14cf14f563f755f3e2a1", | |||||
"title": "test address", | |||||
"area": "Chennai" | |||||
}, | |||||
}); | |||||
//Navigate to login | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to user | |||||
const user = new UserPage(page); | |||||
await user.addressListAPI(); | |||||
expect(postResponse.status()).toBe(200); | |||||
const postResponseBody = await postResponse.json(); | |||||
// Validate response body | |||||
expect(postResponseBody.data).toHaveProperty('id'); // Assuming the API returns an `id` for the new resource | |||||
resourceId = postResponseBody.data.id; | |||||
//Assertion for post | |||||
expect.soft(user.addressList).toContain(postResponseBody.data.addressLine1); | |||||
expect.soft(user.addressList).toContain(postResponseBody.data.addressLine2); | |||||
expect.soft(user.addressList).toContain(postResponseBody.data.stateOrProvince); | |||||
expect.soft(user.addressList).toContain((postResponseBody.data.postalCode).toString()); | |||||
//2. Get address list | |||||
const getResponse = await request.get(baseURL+'/user/addresslist?user_id=670e14cf14f563f755f3e2a1'); | |||||
const getResponseBody = await getResponse.json(); | |||||
//Navigate to Login Page | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to User Page | |||||
await user.addressListAPI(); | |||||
//Assertions | |||||
expect.soft(user.addressList).toContain(getResponseBody.data[1].addressLine1); | |||||
expect.soft(user.addressList).toContain(getResponseBody.data[1].addressLine2); | |||||
expect.soft(user.addressList).toContain(getResponseBody.data[1].stateOrProvince); | |||||
expect.soft(user.addressList).toContain((getResponseBody.data[1].postalCode).toString()); | |||||
//3.Patch Request | |||||
const patchResponse = await request.patch(baseURL+'/user/updateaddress',{ | |||||
data: { | |||||
"addressLine1": "35", | |||||
"addressLine2": "Mount Kitchen Main Road", | |||||
"city": "", | |||||
"stateOrProvince": "Tamil Nadu", | |||||
"postalCode": "123111", | |||||
"phone": "91948011111", | |||||
"deliveryInstructions": null, | |||||
"isDefault": true, | |||||
"user_id": "670e14cf14f563f755f3e2a1", | |||||
"title": "test address", | |||||
"area": "Chennai", | |||||
"address_id": resourceId | |||||
}, | |||||
}); | |||||
const patchResponseBody = await patchResponse.json(); | |||||
//Navigate to Login Page | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
//Navigate to user page | |||||
await user.addressListAPI(); | |||||
//Assertions | |||||
expect.soft(user.addressPatch).toContain(patchResponseBody.data.addressLine1); | |||||
expect.soft(user.addressPatch).toContain(patchResponseBody.data.addressLine2); | |||||
expect.soft(user.addressPatch).toContain(patchResponseBody.data.stateOrProvince); | |||||
expect.soft(user.addressPatch).toContain((patchResponseBody.data.postalCode).toString()); | |||||
// 4. Delete Request | |||||
const deleteResponse = await request.delete(baseURL+'/user/deleteaddress', { | |||||
data:{ | |||||
"user_id": "670e14cf14f563f755f3e2a1", | |||||
"address_id": resourceId, | |||||
} | |||||
}); | |||||
// Validate DELETE response | |||||
expect(deleteResponse.status()).toBe(200); // Typically, HTTP 200 or 204 is expected for successful deletions | |||||
const deleteResponseBody = await deleteResponse.text(); | |||||
}) | |||||
test('TC-API-03,17: Post and Delete Address API',async({request})=>{ | |||||
// 1. Post Response | |||||
const postResponse = await request.post(baseURL+'/user/addnewaddress',{ | |||||
data: { | |||||
"addressLine1": "52", | |||||
"addressLine2": "25", | |||||
"city": "", | |||||
"stateOrProvince": "", | |||||
"postalCode": "123123", | |||||
"phone": "919480111111", | |||||
"deliveryInstructions": null, | |||||
"isDefault": false, | |||||
"user_id": "670e14cf14f563f755f3e2a1", | |||||
"title": "test address", | |||||
"area": "Chennai" | |||||
}, | |||||
}); | |||||
expect(postResponse.status()).toBe(200); | |||||
const postResponseBody = await postResponse.json(); // Parse the response body | |||||
// Validate response body | |||||
expect(postResponseBody.data).toHaveProperty('id'); // Assuming the API returns an `id` for the new resource | |||||
const resourceId = postResponseBody.data.id; | |||||
// 2. Delete Request | |||||
const deleteResponse = await request.delete(baseURL+'/user/deleteaddress', { | |||||
data:{ | |||||
"user_id": "670e14cf14f563f755f3e2a1", | |||||
"address_id": resourceId, | |||||
} | |||||
}); | |||||
// Validate DELETE response | |||||
expect(deleteResponse.status()).toBe(200); | |||||
const deleteResponseBody = await deleteResponse.text(); | |||||
}) | |||||
/*--------------------------------------------------------------------------------------------------------------------*/ | |||||
//Order Page cannot be automated, since the API datas are missing, as it is continued from place order, products are missing |
@ -0,0 +1,637 @@ | |||||
const {test, expect} =require('@playwright/test') | |||||
import { LoginPage } from '../pages/LoginPage'; | |||||
import { AppConfig } from '../pages/AppConfig'; | |||||
test.beforeEach(async ({ page }) => { | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
}); | |||||
//Merchant Verify that the selected currency symbol is displayed correctly(In Regression Suite) | |||||
test('TC-AC-02: Select as Indonesian rupiah (Rp)', async ({page}) =>{ | |||||
//Navigate to App Config Page | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
//Assertions | |||||
const locator = page.locator("//select[@id='oba_appconfig_select_currency']"); | |||||
await expect(locator).toContainText('Indonesian rupiah (Rp)'); | |||||
await page.waitForTimeout(1000); | |||||
await page.close(); | |||||
}); | |||||
//(In Regression Suite) | |||||
test('TC-AC-03: AppConfig button is working or not',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to App Config Oage | |||||
const config = new AppConfig(page); | |||||
await config.openAppConf(); | |||||
await page.waitForTimeout(3000) | |||||
//Assertions | |||||
await expect(await page.locator(config.notificationSoundLoop)).toBeVisible(); | |||||
}) | |||||
/*-----------------------------Call to Action------------------------------------------------*/ | |||||
//Call To Action for empty (In Regression Suite) | |||||
test.skip('Action call for empty ',async ({page})=>{ | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '', 'City','Tamil Nadu'); | |||||
await page.close(); | |||||
}); | |||||
//Call To Action contains numbers starting with 23 | |||||
test('TC-AC-05: Action contains numbers starting with 23 ',async ({page})=>{ | |||||
//Navigate to config Page | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '2355456737', 'City','Tamil Nadu'); | |||||
//Assertions | |||||
const locator = page.locator("//input[@id='oba_appconfig_call_to_action']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//Call To Action for Letters | |||||
test('TC-AC-06: Call To Action for Letters',async ({page})=>{ | |||||
//Navigate to Config Page | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', 'AFHGDGJNBVJ', 'City','Tamil Nadu'); | |||||
//Assertions | |||||
const locator = page.locator("//input[@id='oba_appconfig_call_to_action']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//Call to Action only 9 numbers | |||||
test('TC-AC-07: Call to Action only 9 numbers' ,async({page})=>{ | |||||
//Navigate to config page | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '956456737', 'City','Tamil Nadu'); | |||||
//Assertions | |||||
const locator = page.locator("//input[@id='oba_appconfig_call_to_action']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}) | |||||
//call to action using specail chars | |||||
test('TC-AC-08: call to action using special characters', async({page})=>{ | |||||
//Navigate to App Configuration Page | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '95#5456737', 'City','Tamil Nadu'); | |||||
//Assertions | |||||
const locator = page.locator("//input[@id='oba_appconfig_call_to_action']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}) | |||||
//call to Action using Space | |||||
test('TC-AC-09: space for action call',async({page})=>{ | |||||
//Navigate to App Configuration Page | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', ' 965 526 ', 'City','Tamil Nadu'); | |||||
//Assertions | |||||
const locator = page.locator("//input[@id='oba_appconfig_call_to_action']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//Merchant add International Number | |||||
test('TC-AC-10: International Number', async({page})=>{ | |||||
//Navigate to App Configuration Page | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '456236216514', 'City','Tamil Nadu'); | |||||
//Assertions | |||||
const locator = page.locator("//input[@id='oba_appconfig_call_to_action']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}) | |||||
test('TC-AC-11: Enter Alphabet', async({page})=>{ | |||||
//Navigate to App Configuration Page | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', 'hjgfdjsfjk', 'City','Tamil Nadu'); | |||||
//Assertions | |||||
const locator = page.locator("//input[@id='oba_appconfig_call_to_action']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}) | |||||
test('TC-AC-12: 11 digits', async({page})=>{ | |||||
//Navigate to App Configuration Page | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '96548712396', 'City','Tamil Nadu'); | |||||
//Assertions | |||||
const locator = page.locator("//input[@id='oba_appconfig_call_to_action']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}) | |||||
test('TC-AC-16: 10 digits', async({page})=>{ | |||||
//Navigate to App Configuration Page | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
//Assertions | |||||
const PhoneNumber = await page.locator("//input[@id='oba_appconfig_call_to_action']").inputValue(); | |||||
expect.soft(PhoneNumber).toContain(('9565456737').toString()); | |||||
await page.close(); | |||||
}) | |||||
//Merchant add valid details | |||||
test('TC-AC-17: Valid Number starts with 6,7,8,9',async({page})=>{ | |||||
//Navigate to App Configuration Page | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '6565456737', 'City','Tamil Nadu'); | |||||
//Assertions | |||||
const actionNumber = await page.locator("//input[@id='oba_appconfig_call_to_action']").inputValue(); | |||||
expect.soft(actionNumber).toContain(('6565456737').toString()); | |||||
await page.close(); | |||||
}) | |||||
//Unable to assert | |||||
/*-----------------------------------------------------------------------------------*/ | |||||
//user select Country | |||||
test.skip('select Country', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
const locator = page.locator("//option[@value='CITY']"); | |||||
await expect(locator).toBeVisible(); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user select State | |||||
test.skip('select State', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user select City | |||||
test.skip('select City', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
const locator = page.locator(("//option[@value='CITY']").inputValue()); | |||||
await expect(locator).toBeVisible(); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user select Pincode | |||||
test.skip('select Pincode', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user select Landmark | |||||
test.skip('select Landmark', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user select None | |||||
test.skip('select None', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user enter the less than cart value | |||||
test.skip('less than cart value ', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user enter the cart value equal to the value | |||||
test.skip('cart value equal to the value', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user enter cart zero | |||||
test.skip('enter cart zero ', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user enter the delivary charges as zero | |||||
test.skip('enter the delivary charges as zero', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user enter the Delivary chrages as more than given. | |||||
test.skip('Delivary chrages as more than given.', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user enter the less cart value and add delivary charg to | |||||
test.skip('enter the less cart value and add delivary charg to', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user enter the less than cart value | |||||
test.skip('enter the less than cart value ', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user enter the zero as cart value and delivary charge | |||||
test.skip('enter the zero as cart value and delivary charge', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '0', '0', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user enter sound loop as 0 | |||||
test.skip(' enter sound loop as 0', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','0','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user enter sound loop as 100 | |||||
test.skip(' enter sound loop as 100', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','100','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user enter sound loop as 10 | |||||
test.skip(' enter sound loop as 10', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','10','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//user enter cart value to max 999999 | |||||
test.skip('enter cart value to max 999999', async ({page}) =>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const config = new AppConfig(page); | |||||
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '999999', '35', '9565456737', 'City','Tamil Nadu'); | |||||
await page.waitForTimeout(3000); | |||||
await page.close(); | |||||
}); | |||||
//test('complete AppConfig page to check API',async ({page,request})=>{ | |||||
// const login = new LoginPage(page); | |||||
// await login.gotoLoginPage(); | |||||
// await login.loginWithCrtPassword(); | |||||
// await page.waitForTimeout(5000); | |||||
// const config = new AppConfig(page); | |||||
// await config.functionalityAppConfig('Argentine peso ($)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); | |||||
// await page.close(); | |||||
// await page.waitForTimeout(5000); | |||||
//await login.gotoLoginPage(); | |||||
//await login.loginWithCrtPassword(); | |||||
//await page.waitForTimeout(5000); | |||||
//await config.openAppConf(); | |||||
//const text =page.locator(config.currency).allInnerTexts(); | |||||
//console.log(text); | |||||
//expect.soft(config.currencyAPI).toContain("Argentine peso ($)"); | |||||
//}) | |||||
/* | |||||
test('AppConfig 3',async ({page})=>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
const config = new AppConfig(page); | |||||
// await config.toggleButton(); | |||||
await config.areaSelectionTest('State'); | |||||
await page.waitForTimeout(3000) | |||||
// await expect(await page.locator("//div[@class='card is_shop_open_card']//span[@class='flip-indecator']").isChecked()).toBeTruthy(); | |||||
// await expect(await expect("//div[@class='card is_shop_open_card']//span[@class='flip-indecator']").toHaveText('ON')) | |||||
// await config.functionalityAppConfig('UAE dirham (د.إ;)', '400', '35', '9565456737', 'State', 'Tamil Nadu'); | |||||
// await page.waitForTimeout(3000) | |||||
// await expect(page.getByLabel("ON")).toBeVisible(); | |||||
}) | |||||
test('APITesting for app config',async ({request,page})=>{ | |||||
const response = await request.get('https://dev.orderbookings.com/api/config/919480707707?merchantCode=919480707707') | |||||
console.log(await response.json()) | |||||
const res = await response.json(); | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
const config = new AppConfig(page); | |||||
await config.openAppConf(); | |||||
expect.soft(config.merchantCode).toContain(res.data.merchantCode); | |||||
const textBoxValue=await page.locator(config.calltoactionAPI).inputValue(); | |||||
expect.soft(textBoxValue).toContain(res.data.call_to_action); | |||||
//const currencyValue=await page.locator(config.currencyAPI).inputValue(); | |||||
// expect.soft(currencyValue).toContain(res.data.currency_code); | |||||
const notificationLoop = await page.locator(config.notificationSoundLoopAPI).inputValue(); | |||||
expect.soft(notificationLoop).toContain((res.data.notification_sound_loop).toString()); | |||||
const cancellationTillResponse = await page.locator(config.cancellationTillAPI).inputValue(); | |||||
expect.soft(cancellationTillResponse).toContain((res.data.cancellation_till).toString()); | |||||
const minimumCartPrizeResponse = await page.locator(config.minimumCartPrizeAPI).inputValue(); | |||||
expect.soft( minimumCartPrizeResponse).toContain((res.data.minimum_cart_price).toString()); | |||||
const deliveryChargeResponse = await page.locator(config.deliveryChargeAPI).inputValue(); | |||||
expect.soft( deliveryChargeResponse).toContain((res.data.delivery_charge).toString()); | |||||
expect.soft(config.areaTypeAPI).toContain(res.data.area_type); | |||||
// const toggleButton = await page.locator(config.onOffButton).isChecked(); | |||||
// const isNowToggledOn = await toggleButton.getAttribute('OFF') === 'true'; | |||||
// expect.soft(toggleButton).toContain(res.data.isShopOpen); | |||||
// expect(toggleButton).toBe(true) | |||||
//expect.soft(config.currencyAPI).toContain(res.data.currency_code); | |||||
// expect.soft(coupon.couponCodeGuest).toContain(res.data[0].campaign_code); | |||||
// expect.soft(coupon.forUsersGuest).toContain(res.data[0].for); | |||||
}) | |||||
*/ |
@ -0,0 +1,87 @@ | |||||
const {test, expect} =require('@playwright/test') | |||||
import { LoginPage } from '../pages/LoginPage'; | |||||
import { CatlogPage } from '../pages/CatlogPage'; | |||||
test.beforeEach(async ({ page }) => { | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
}); | |||||
test('TC-CP-14: CatlogButton is working?',async ({page})=>{ | |||||
//Navigate to catlog page | |||||
const catlog = new CatlogPage(page); | |||||
await catlog.clickCatalogButton(); | |||||
await page.waitForTimeout(3000) | |||||
//Assertion | |||||
await expect(await page.locator(catlog.catlogPageValidate)).toBeVisible(); | |||||
}) | |||||
//Not able to assert | |||||
test.skip('Buds List is selected',async ({page})=>{ | |||||
//Navigate to Catlog page | |||||
const catlog = new CatlogPage(page); | |||||
await catlog.imageUpload('BUDS_LIST', 'PRODUCTS_LEFT'); | |||||
await page.waitForTimeout(3000) | |||||
}) | |||||
test.skip('Buds sliding is selected',async ({page})=>{ | |||||
//Navigate to Catlog page | |||||
const catlog = new CatlogPage(page); | |||||
await catlog.imageUpload('BUDS_SLIDING', 'PRODUCTS_LEFT'); | |||||
await page.waitForTimeout(3000) | |||||
}) | |||||
test.skip('Buds grid is selected',async ({page})=>{ | |||||
//Navigate to Catlog page | |||||
const catlog = new CatlogPage(page); | |||||
await catlog.imageUpload('BUDS_GRID', 'PRODUCTS_LEFT'); | |||||
await page.waitForTimeout(3000) | |||||
}) | |||||
test.skip('product left is selected',async ({page})=>{ | |||||
//Navigate to Catlog page | |||||
const catlog = new CatlogPage(page); | |||||
await catlog.imageUpload('BUDS_GRID', 'PRODUCTS_LEFT'); | |||||
await page.waitForTimeout(3000) | |||||
}) | |||||
test.skip('product ping pong is selected',async ({page})=>{ | |||||
//Navigate to catlog page | |||||
const catlog = new CatlogPage(page); | |||||
await catlog.imageUpload('BUDS_GRID', 'PRODUCTS_PING_PONG'); | |||||
await page.waitForTimeout(3000) | |||||
}) | |||||
test.skip('product right is selected',async ({page})=>{ | |||||
//Navigate to Catlog Page | |||||
const catlog = new CatlogPage(page); | |||||
await catlog.imageUpload('BUDS_GRID', 'PRODUCTS_RIGHT'); | |||||
await page.waitForTimeout(3000) | |||||
}) | |||||
test.skip('product grid is selected',async ({page})=>{ | |||||
//Navigate to catlog page | |||||
const catlog = new CatlogPage(page); | |||||
await catlog.imageUpload('BUDS_GRID', 'PRODUCTS_GRID'); | |||||
await page.waitForTimeout(3000) | |||||
}) |
@ -0,0 +1,58 @@ | |||||
const {test, expect} =require('@playwright/test') | |||||
import { LoginPage } from '../pages/LoginPage'; | |||||
import { ContentPage } from '../pages/ContentPage'; | |||||
test.beforeEach(async ({ page }) => { | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
}); | |||||
test('TC-CON-01: Content page is opening?',async ({page})=>{ | |||||
//Navigate to content page | |||||
const content = new ContentPage(page); | |||||
await content.clickContentButton(); | |||||
//Assertion | |||||
await expect(await page.locator(content.contentPageValidate)).toBeVisible(); | |||||
}) | |||||
//unable to assert | |||||
test.skip('Content page is able to save in privacy policy',async ({page})=>{ | |||||
//Navigate to content page | |||||
const content = new ContentPage(page); | |||||
await content.ContentToSave('Privacy Policy'); | |||||
await page.waitForTimeout(3000); | |||||
}) | |||||
test.skip('Content page is able to save in Terms & Conditions',async ({page})=>{ | |||||
//Navigate to content page | |||||
const content = new ContentPage(page); | |||||
await content.ContentToSave('Terms & Conditions'); | |||||
await page.waitForTimeout(3000); | |||||
}) | |||||
test.skip('Content page is able to save in About Us',async ({page})=>{ | |||||
//Navigate to content page | |||||
const content = new ContentPage(page); | |||||
await content.ContentToSave('About Us'); | |||||
await page.waitForTimeout(3000); | |||||
}) |
@ -0,0 +1,22 @@ | |||||
const {test, expect} =require('@playwright/test') | |||||
import { LoginPage } from '../pages/LoginPage'; | |||||
import { CouponPage } from '../pages/Couponpage'; | |||||
test('TC-COU-01: Coupon Button working?',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to coupon page | |||||
const coupon = new CouponPage(page); | |||||
await coupon.viewCoupon(); | |||||
//Assertion | |||||
await expect(await page.locator("//th[normalize-space()='Coupon Code']")).toBeVisible(); | |||||
}) |
@ -0,0 +1,49 @@ | |||||
const {test, expect} =require('@playwright/test') | |||||
import { LoginPage } from '../pages/LoginPage'; | |||||
import { Feedback } from '../pages/Feedback'; | |||||
test('TC-FP-01: Feedback page is opening?',async ({page})=>{ | |||||
//NAVIGATE TO LOGIN PAGE | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//NAVIGATE TO FEEDBACK PAGE | |||||
const feedback = new Feedback(page); | |||||
await feedback.clickFeedbackButton(); | |||||
//ASSERTION | |||||
await expect(await page.locator("//label[normalize-space()='Select feedback Type']")).toBeVisible(); | |||||
}) | |||||
test('TC-API-18: Submit Feedback_API',async ({request,page})=>{ | |||||
//POST REQUEST AND STORE RESPONSE | |||||
const response = await request.post('https://dev.orderbookings.com/api/merchant/submitFeedback', | |||||
{ | |||||
data:{ | |||||
"feedback_created_ts": null, | |||||
"feedback_from_email": "bigil@gmail.com", | |||||
"feedback_text": "sdfasdf4fsdf", | |||||
"feedback_updated_ts": null, | |||||
"merchantCode": "919480707707", | |||||
"feedback_from_name": "Bigil", | |||||
"feedback_from_phone": "919480111111" | |||||
} | |||||
}); | |||||
const res = await response.json(); | |||||
//ASSERTION | |||||
expect(res.data).toBe(true); | |||||
await page.reload(); | |||||
}) |
@ -1,23 +0,0 @@ | |||||
const {test, expect} =require('@playwright/test') | |||||
test('Home Page',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
const pageTitle=await page.title(); | |||||
console.log('Page title is:',pageTitle); | |||||
await expect(page).toHaveTitle('OBA'); | |||||
const pageURL=page.url(); | |||||
console.log('Page URL is:',pageURL); | |||||
await expect(page).toHaveURL('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.fill("//input[@name='oba_login_emailid']",'rabisundaram@gmail.com') | |||||
console.log('Mail is Entered'); | |||||
await page.fill("//input[@placeholder='Password']",'#12345678A') | |||||
console.log('Password is Entered'); | |||||
await page.click("//button[normalize-space()='SIGN IN']") | |||||
await page.waitForTimeout(5000); | |||||
console.log('Password is Logged in Successfully'); | |||||
await page.close(); | |||||
}) |
@ -0,0 +1,180 @@ | |||||
const {test, expect} =require('@playwright/test') | |||||
import { LoginPage } from '../pages/LoginPage'; | |||||
//For Valid Details. | |||||
test('TC-LP-01: Login test with correct credentials',async ({page})=>{ | |||||
//Navigate to login page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.login('xpcv2@rustyload.com','7777777777') | |||||
//Assertion | |||||
await expect(page).toHaveURL('https://dev.orderbookings.com/merchant/index/index'); //check the expected url is having same url | |||||
await page.close(); | |||||
}) | |||||
//@ Email without @ symbol | |||||
test('TC-LP-03: Login test Merchant enters email without @ symbol',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.login('rabisundaatramgmail.com','#12345678A') | |||||
//Assertion | |||||
await expect(await page.locator("//small[@class='text-danger text-center']")).toBeVisible(); //negative invalid email | |||||
await page.close(); | |||||
}) | |||||
// Email without domain | |||||
test('TC-Lp-04: Login test Merchant enters email without domain',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.login('rabisundaatram@.com','#12345678A') | |||||
//Assertion | |||||
await expect(await page.locator("//small[@class='text-danger text-center']")).toBeVisible(); //negative invalid email | |||||
await page.close(); | |||||
}) | |||||
// Email with excessive Length | |||||
test('TC-LP-05: Login test Merchant enters Email with excessive Length',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.login('rabisundaatramiuegkdsfyuydklashmnfbdkashnbv@gmail.com','#12345678A') | |||||
//Assertion | |||||
await expect(await page.locator("//small[@class='text-danger text-center']")).toBeVisible(); //negative invalid email | |||||
await page.close(); | |||||
}) | |||||
//Email with consecutive dots | |||||
test('TC-LP-07: Login test Merchant enters Email with consecutive dots',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.login('rabisundaatram@gmail..com','#12345678A') | |||||
//Assertion | |||||
await expect(await page.locator("//small[@class='text-danger text-center']")).toBeVisible(); //negative invalid email | |||||
await page.close(); | |||||
}) | |||||
//Empty Username | |||||
test('TC-LP-08: Login test with Empty Email',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.login('','#12345678A') | |||||
//Assertion | |||||
const locator = page.locator("//input[@name='oba_login_emailid']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
//Empty Password | |||||
test('TC-LP-09: Login test with no password',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.login('rabisundaram@gmail.com','') | |||||
//Assertion | |||||
const locator = page.locator("//input[@placeholder='Password']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
//Invalid Username | |||||
test('TC-LP-10: Login test with wrong Email',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.login('rabisundaatram@gmail.com','#12345678A') | |||||
//Assertion | |||||
await expect(await page.locator("//small[@class='text-danger text-center']")).toBeVisible(); //negative invalid email | |||||
await page.close(); | |||||
}) | |||||
//Invalid Password | |||||
test('TC-LP-11: Login test with wrong password',async ({page})=>{ | |||||
//Navigate to login page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.login('rabisundaram@gmail.com','#123466678A') | |||||
//Assertion | |||||
await expect(await page.locator("//small[@class='text-danger text-center']")).toBeVisible(); //negative invalid email | |||||
await page.close(); | |||||
}) | |||||
//Forgot Password working or not? | |||||
test('TC-LP-12: ForgotPassword',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await page.waitForTimeout(3000) | |||||
await login.forgetPasswordLink() | |||||
await page.waitForTimeout(3000) | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='RESET']")).toBeVisible(); | |||||
}) | |||||
//Back To Login working? | |||||
test('TC-LP-13: BacktoLogin',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await page.waitForTimeout(3000) | |||||
await login.forgetPasswordLink() | |||||
await page.waitForTimeout(3000) | |||||
await login.backToLoginLink() | |||||
await page.waitForTimeout(3000) | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='SIGN IN']")).toBeVisible(); | |||||
}) | |||||
// | |||||
test('TC-LP-14: Invalid mail',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.login('midhaja','#12345678A') | |||||
await page.waitForTimeout(3000) | |||||
await page.locator("//div[@role='alert']").textContent() | |||||
//Assertion | |||||
await expect(await page.locator("//div[@role='alert']")).toBeVisible(); | |||||
}) | |||||
@ -1,351 +0,0 @@ | |||||
const {test, expect} =require('@playwright/test'); | |||||
const { clear } = require('console'); | |||||
test.describe('MerchantAppConf',()=>{ | |||||
test('AppConfTest1',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.fill("//input[@name='oba_login_emailid']",'rabisundaram@gmail.com') | |||||
await page.fill("//input[@placeholder='Password']",'#12345678A') | |||||
await page.click("//button[normalize-space()='SIGN IN']") | |||||
await page.click("//span[normalize-space()='AppConfig']") | |||||
await page.waitForTimeout(5000); | |||||
console.log('AppConf Button is working'); | |||||
}) | |||||
test('AppConfTest2',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.fill("//input[@name='oba_login_emailid']",'rabisundaram@gmail.com') | |||||
await page.fill("//input[@placeholder='Password']",'#12345678A') | |||||
await page.click("//button[normalize-space()='SIGN IN']") | |||||
await page.click("//span[normalize-space()='AppConfig']") | |||||
await page.waitForTimeout(5000); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'UAE dirham (د.إ;)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('UAE dirham is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Afghan afghani (Afs)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Afghan afghani is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Albanian lek (L)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Albanian lek is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Armenian dram (AMD)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Armenian dram is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Netherlands Antillean gulden (NAƒ)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Netherlands Antillean gulden is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Angolan kwanza (Kz)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Angolan kwanza is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Argentine peso ($)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Argentine peso is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Australian dollar ($)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Australian dollar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Aruban florin (ƒ)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Aruban florin is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Azerbaijani manat (AZN)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Azerbaijani manat is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Bosnia and Herzegovina konvertibilna marka (KM)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Bosnia and Herzegovina konvertibilna marka is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Barbadian dollar (Bds$)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Barbadian dollar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Bangladeshi taka (৳)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Bangladeshi taka is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Bulgarian lev (BGN)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Bulgarian lev is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Bahraini dinar (.د.ب)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Bahraini dinar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Burundi franc (FBu)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Burundi franc is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Bermudian dollar (BD$)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Bermudian dollar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Brunei dollar (B$)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Brunei dollar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Bolivian boliviano (Bs.)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Bolivian boliviano is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Brazilian real (R$)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Brazilian real is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Bahamian dollar (B$)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Bahamian dollar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Bhutanese ngultrum (Nu.)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Bhutanese ngultrum is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Botswana pula (P)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Botswana pula is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Belarusian ruble (Br)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Belarusian ruble is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Belize dollar (BZ$)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Belize dollar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Canadian dollar ($)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Canadian dollar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Congolese franc (F)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Congolese franc is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Swiss franc (Fr.)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Swiss franc is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Chilean peso ($)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Chilean peso is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Chinese/Yuan renminbi (¥)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Chinese/Yuan renminbi is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Colombian peso (Col$)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Colombian peso is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Costa Rican colon (₡)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Costa Rican colon is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Cuban peso ($)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Cuban peso is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Cape Verdean escudo (Esc)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Cape Verdean escudo is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Czech koruna (Kč)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Czech koruna is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Djiboutian franc (Fdj)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Djiboutian franc is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Danish krone (Kr)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Danish krone is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Dominican peso (RD$)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Dominican peso is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Algerian dinar (د.ج)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Algerian dinar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Estonian kroon (KR)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Estonian kroon is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Egyptian pound (£)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Egyptian pound is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Eritrean nakfa (Nfa)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Eritrean nakfa is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Ethiopian birr (Br)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Ethiopian birr is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'European Euro (€)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('European Euro is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Fijian dollar (FJ$)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Fijian dollar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Falkland Islands pound (£)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Falkland Islands pound (£) is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'British pound (£)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('British pound is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Georgian lari (GEL)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Georgian lari is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Ghanaian cedi (GH₵)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Ghanaian cedi is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Gibraltar pound (£)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Gibraltar pound is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Gambian dalasi (D)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Gambian dalasi is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Guinean franc (FG)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Guinean franc is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Central African CFA franc (CFA)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Central African CFA franc is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Guatemalan quetzal (Q)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Guatemalan quetzal is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Guyanese dollar (GY$)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Guyanese dollar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Hong Kong dollar (HK$)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Hong Kong dollar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Honduran lempira (L)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Honduran lempira is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Croatian kuna (kn)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Croatian kuna is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Haitian gourde (G)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Haitian gourde is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Hungarian forint (Ft)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Hungarian forint is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Indonesian rupiah (Rp)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Indonesian rupiah is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Israeli new sheqel (₪)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Israeli new sheqel is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Indian rupee (₹)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Indian rupee is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Iraqi dinar (د.ع)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Iraqi dinar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Iranian rial (IRR)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Iranian rial is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Icelandic króna (kr)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Icelandic króna is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Jamaican dollar (J$)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Jamaican dollar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Jordanian dinar (JOD)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Jordanian dinar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Japanese yen (¥)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Japanese yen is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Kenyan shilling (KSh)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Kenyan shilling is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Kyrgyzstani som (сом)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Kyrgyzstani som is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Cambodian riel (៛)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Cambodian riel is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Comorian franc (KMF)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Comorian franc is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'North Korean won (W)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('North Korean won is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'South Korean won (W)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('South Korean won is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Kuwaiti dinar (KWD)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Kuwaiti dinar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Cayman Islands dollar (KY$)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Cayman Islands dollar is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Kazakhstani tenge (T)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Kazakhstani tenge is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Lao kip (KN)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Lao kip is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Lebanese lira (£)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Lebanese lira is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Sri Lankan rupee (Rs)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Sri Lankan rupee is selected'); | |||||
await page.locator(" //select[@id='oba_appconfig_select_currency']").selectOption({label:'Liberian dollar (L$)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Liberian dollar is selected'); | |||||
}) | |||||
}) |
@ -1,70 +0,0 @@ | |||||
const {test, expect} =require('@playwright/test'); | |||||
const { clear } = require('console'); | |||||
test.describe('MerchantOrder',()=>{ | |||||
test('OrderTest1',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.fill("//input[@name='oba_login_emailid']",'rabisundaram@gmail.com') | |||||
await page.fill("//input[@placeholder='Password']",'#12345678A') | |||||
await page.click("//button[normalize-space()='SIGN IN']") | |||||
await page.click("//li[@id='app-menu-list-orders']//a[@class='app-menu__item']") | |||||
// await page.click("//li[@id='app-menu-list-orders']//a[@class='app-menu__item']") | |||||
const orderlistlink = await page.locator("//a[normalize-space()='Order List']") | |||||
await expect(orderlistlink).toBeVisible(); | |||||
console.log('Order Button is working'); | |||||
// await page.close(); | |||||
}) | |||||
test('OrderTest2',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.fill("//input[@name='oba_login_emailid']",'rabisundaram@gmail.com') | |||||
await page.fill("//input[@placeholder='Password']",'#12345678A') | |||||
await page.click("//button[normalize-space()='SIGN IN']") | |||||
await page.click("//li[@id='app-menu-list-orders']//a[@class='app-menu__item']") | |||||
await page.click("//a[normalize-space()='Order List']") | |||||
console.log('OrderList Button is working'); | |||||
// await page.click("//select[@id='oba_edit_order_status_filter']") | |||||
await page.close(); | |||||
}) | |||||
test('OrderTest3',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.fill("//input[@name='oba_login_emailid']",'rabisundaram@gmail.com') | |||||
await page.fill("//input[@placeholder='Password']",'#12345678A') | |||||
await page.click("//button[normalize-space()='SIGN IN']") | |||||
await page.click("//li[@id='app-menu-list-orders']//a[@class='app-menu__item']") | |||||
await page.click("//a[normalize-space()='Order List']") | |||||
await page.click("//select[@id='oba_edit_order_status_filter']") | |||||
console.log('order status dropdown is working') | |||||
await page.close(); | |||||
}) | |||||
test('OrderTest4',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.fill("//input[@name='oba_login_emailid']",'rabisundaram@gmail.com') | |||||
await page.fill("//input[@placeholder='Password']",'#12345678A') | |||||
await page.click("//button[normalize-space()='SIGN IN']") | |||||
await page.click("//li[@id='app-menu-list-orders']//a[@class='app-menu__item']") | |||||
await page.click("//a[normalize-space()='Order List']") | |||||
await page.locator("//select[@id='oba_edit_order_status_filter']").selectOption({label:'ORDER_STATUS_DECLINED'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Order status declined is selected'); | |||||
await page.locator("//select[@id='oba_edit_order_status_filter']").selectOption({label:'ORDER_STATUS_REQUESTED'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Order status requested is selected'); | |||||
await page.locator("//select[@id='oba_edit_order_status_filter']").selectOption({label:'ORDER_STATUS_PENDING'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Order status Pending is selected'); | |||||
await page.locator("//select[@id='oba_edit_order_status_filter']").selectOption({label:'ORDER_STATUS_CANCELLED'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Order status cancelled is selected'); | |||||
await page.locator("//select[@id='oba_edit_order_status_filter']").selectOption({label:'ORDER_STATUS_COMPLETE'}); | |||||
console.log('Order status complete is selected'); | |||||
await page.close(); | |||||
}) | |||||
}) | |||||
@ -0,0 +1,137 @@ | |||||
const {test, expect} =require('@playwright/test') | |||||
import { LoginPage } from '../pages/LoginPage'; | |||||
import { NotificationPage } from '../pages/NotificationPage'; | |||||
test('TC-NP-01: Notification Button is working?',async ({page}) =>{ | |||||
//login Function | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(500); | |||||
//Notify Function using Send Notification by Name | |||||
const notified = new NotificationPage(page); | |||||
await notified.notificationPageCheck(); | |||||
await expect(await page.locator(notified.selecttype)).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test.skip('Working_NotifybyName', async ({page}) =>{ | |||||
//login Function | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(500); | |||||
//Notify Function using Send Notification by Name | |||||
const Notified = new NotificationPage(page); | |||||
await Notified.wholeNotificationSettingNew('Send notification by name','Shubya','Shubya','Successfully Added Notification by Name','2026','April 2026','2','') | |||||
await page.reload(); | |||||
await expect(await page.locator("//button[normalize-space()='OK']")).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test.skip('Duplicate NotifybyName', async ({page}) =>{ | |||||
//login Function | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(500); | |||||
//Notify Function using Send Notification by Name | |||||
const Notified = new NotificationPage(page); | |||||
await Notified.NotifyMeWithName('Send notification by name','Shubya','Shubya','Successfully Added Notification by Name'); | |||||
await Notified.setDate('2026','April 2026','2'); | |||||
//await Notified.setTime('8','45'); | |||||
await Notified.selectFile('C:/Automate Testing/OBA Automation/Biriyani.jpg'); | |||||
await Notified.sendNotification(); | |||||
// await page.waitForTimeout(1000); | |||||
await page.close(); | |||||
}) | |||||
test.skip('NotifybyArea', async ({page}) =>{ | |||||
//login Function | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(1000); | |||||
//Notify Function using Send Notification by Area | |||||
const Notified = new Notify(page); | |||||
await Notified.NotifyMewithArea('Send notification by Area','Shubya','586101','Successfully Added Notification by area'); | |||||
await Notified.setDate('2026','April 2026','2'); | |||||
await Notified.selectFile('C:/PlayWright/files/SS.jpeg'); | |||||
await Notified.sendNotification(); | |||||
await page.close(); | |||||
}) | |||||
test.skip('check time is set',async({page})=>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(1000); | |||||
const Notified = new Notify(page); | |||||
await Notified.NotifyMewithArea('Send notification by Area','Shubya','ABCDF','Successfully Added Notification by area'); | |||||
await page.waitForTimeout(100); | |||||
await Notified.setTime('8','45'); | |||||
await page.waitForTimeout(100); | |||||
await page.close(); | |||||
}) | |||||
test.skip('check Date Set',async({page})=>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(1000); | |||||
const Notified = new Notify(page); | |||||
await Notified.setDate('2025','March 2025','27'); | |||||
await page.close(); | |||||
}) | |||||
test.skip('check Send Notification',async({page})=>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(1000); | |||||
const dash = new DashBoard(page); | |||||
await dash.gotoNotification() | |||||
const Notified = new Notify(page); | |||||
await Notified.sendNotification(); | |||||
await page.close(); | |||||
}) | |||||
test.skip('check file selected',async({page})=>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(1000); | |||||
const Notified = new Notify(page); | |||||
await Notified.selectFile('C:/PlayWright/files/SS.jpeg'); | |||||
await Notified.sendNotification(); | |||||
await page.close(); | |||||
}) |
@ -0,0 +1,153 @@ | |||||
const {test, expect} =require('@playwright/test') | |||||
import { clear } from 'console'; | |||||
import { LoginPage } from '../pages/LoginPage'; | |||||
import { OrderPage } from '../pages/OrderPage'; | |||||
test('TC-OP-01: Order Button',async ({page})=>{ | |||||
//Navigate to login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to order page | |||||
const order = new OrderPage(page); | |||||
await order.clickOrdersButton(); | |||||
await page.waitForTimeout(5000); | |||||
//Assertion | |||||
await expect(await page.locator("//a[normalize-space()='Order List']")).toBeVisible(); | |||||
}) | |||||
test('Tc-OP-02: Order List Button',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to Order Page | |||||
const order = new OrderPage(page); | |||||
await order.clickOrdersListButton(); | |||||
//Assertion | |||||
await expect(await page.locator("//select[@id='oba_edit_order_status_filter']")).toBeVisible(); | |||||
}) | |||||
test('TC-OP-03: Order Status Dropdown Count',async ({page})=>{ | |||||
//Navigate to login page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to order page | |||||
const order = new OrderPage(page); | |||||
await order.clickOrdersListButton(); | |||||
await page.waitForTimeout(5000); | |||||
//Assertion | |||||
const options = await page.locator('#oba_edit_order_status_filter option') | |||||
await expect(options).toHaveCount(5); | |||||
}) | |||||
test.skip('Order status dropdown menu',async ({page})=>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const order = new OrderPage(page); | |||||
await order.clickOrdersListButton(); | |||||
const value= await page.locator("//select[@id='oba_edit_order_status_filter']").textContent() | |||||
console.log(value); | |||||
}) | |||||
test.skip('Order status selected',async ({page})=>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
const order = new OrderPage(page); | |||||
await order.orderStatusCheck('ORDER_STATUS_REQUESTED'); | |||||
}) | |||||
test.skip('Order declined',async ({page})=>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
const order = new OrderPage(page); | |||||
await order.textBoxSearch('ORDER_STATUS_DECLINED', 'Tomato Rice and Chicken Biriyani'); | |||||
}) | |||||
test.skip('Order requested',async ({page})=>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
const order = new OrderPage(page); | |||||
await order.textBoxSearch('ORDER_STATUS_REQUESTED', 'Tomato Rice and Chicken Biriyani'); | |||||
}) | |||||
test.skip('Order pending',async ({page})=>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
const order = new OrderPage(page); | |||||
await order.textBoxSearch('ORDER_STATUS_PENDING', 'Tomato Rice and Chicken Biriyani'); | |||||
}) | |||||
test.skip('Order cancelled',async ({page})=>{ | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
const order = new OrderPage(page); | |||||
await order.textBoxSearch('ORDER_STATUS_CANCELLED', 'Tomato Rice and Chicken Biriyani'); | |||||
}) | |||||
test('TC-OP-30,31,32,33,34: Order by ID API',async ({request,page})=>{ | |||||
const response = await request.get('https://dev.orderbookings.com/api/order/syncOrders?user_id=670766e4272db54e96e423e0&phone=919480111222&lastupdatetime=0&merchantCode=919480707707&role=ROLE_TYPE_MERCHANT') | |||||
const res = await response.json(); | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
const order = new OrderPage(page); | |||||
const result = await order.textBoxSearch('ORDER_STATUS_COMPLETE', 'Shubya'); | |||||
expect.soft(order.orderName).toContain(res.data[0].ordered_by_name); | |||||
expect.soft(order.orderEmail).toContain(res.data[0].ordered_by_email); | |||||
expect.soft(order.orderPhone).toContain((res.data[0].ordered_by_address.phone).toString()); | |||||
expect.soft(order.orderCost).toContain((res.data[0].order_cost).toString()); | |||||
expect.soft(order.orderQty).toContain((res.data[0].ordered_items_qty[0]).toString()); | |||||
}) |
@ -1,911 +0,0 @@ | |||||
const {test, expect} =require('@playwright/test') | |||||
const { clear } = require('console'); | |||||
test.describe('GroupWithCorrectDetails',()=>{ | |||||
test('RegisterTest1',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
console.log('Register button is working'); | |||||
await page.close(); | |||||
}) | |||||
test('RegisterTest2',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
console.log('Name is Entered'); | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
console.log('Email is Entered'); | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('Country Code is Selected'); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
console.log('Phone Number is Entered'); | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
console.log('Address is Entered'); | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
console.log('Company Name is Entered'); | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('BusinessType is selected') | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('City is selected') | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
console.log('Password is Entered'); | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
//await page.waitForTimeout(5000); | |||||
console.log('Successfully Registered'); | |||||
console.log('Email is registered successfully and mail is sent'); | |||||
await page.close(); | |||||
}) | |||||
}) | |||||
test.describe('TC_Name',()=>{ | |||||
test('Name1',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'') | |||||
console.log('Name is empty it should get error'); | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
//PopUP | |||||
// const validationMessage = await page.locator('.validation-message'); // Adjust selector as needed | |||||
// await validationMessage.waitFor({ state: 'visible' }); | |||||
// Assert the validation message content | |||||
// const messageText = await validationMessage.textContent(); | |||||
// expect(messageText).toBe('Name is required'); | |||||
}) | |||||
test('Name2',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'52658954623') | |||||
console.log('Number is entered it should get error'); | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
//PopUP | |||||
}) | |||||
test('Name3',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'qwertyuioplkjhgfdsazxcvbnmmnbvcxzasdfghjklpoiuytre') | |||||
console.log('50 Characters is entered it should get error'); | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
//PopUP | |||||
}) | |||||
test('Name4',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'@#$_+(&%$#%$') | |||||
console.log('Special Characters is entered it should get error'); | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
//PopUP | |||||
}) | |||||
test('Name5',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'@#$_+(&%$#%$') | |||||
console.log('Special Characters is entered it should get error'); | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
//PopUP | |||||
}) | |||||
test('Name6',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'@#$_+(&%$#%$') | |||||
console.log('Special Characters is entered it should get error'); | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
//PopUP | |||||
}) | |||||
}) | |||||
test.describe('TC_EMail',()=>{ | |||||
test('Email1',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'') | |||||
console.log('Email is empty, it should get error'); | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Email2',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaramgmail.com') | |||||
console.log('Email without @ symbol, it should get error'); | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Email3',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'asfg@asfg.com') | |||||
console.log('Email with invalid domain, it should get error'); | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Email4',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram.gmail@com') | |||||
console.log('Invalid Email format, it should get error'); | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Email5',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@#$#%5.com') | |||||
console.log('Email with invalid characters, it should get error'); | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Email6',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundafsdkjhkmnfsdjkhfsdkjhnmnikjnkdram') | |||||
console.log('Email with Excessive length, it should get error'); | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Email7',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail...com') | |||||
console.log('Email with continous dot, it should get error'); | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Email8',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'example@gmail.example.com') | |||||
console.log('user enters email with subdomain is accepted'); | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Email9',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'akshay.vasav@gmail.com') | |||||
console.log('user enters special character in local part is accepted'); | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Email10',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'AKSHAY@gmail.com') | |||||
console.log('user enters email with Uppercase charecters is accepted'); | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
}) | |||||
test.describe('TC_Phone',()=>{ | |||||
test('Phone1',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'ABCDERFGTY') | |||||
console.log('Characters in Phone, it should get error'); | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Phone2',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'986787$%^8') | |||||
console.log('Special Characters in Phone, it should get error'); | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Phone3',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'ABCDERFGTY') | |||||
console.log('Characters in Phone, it should get error'); | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Phone4',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'25416325147') | |||||
console.log('11 Numbers in Phone, it should get error'); | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Phone5',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'254163251') | |||||
console.log('9 Numbers in Phone, it should get error'); | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Phone6',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",' 254163251') | |||||
console.log('Space in Phone, it should get error'); | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Phone7',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'') | |||||
console.log('Blank Space in Phone, it should get error'); | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Phone8',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'96678567367872') | |||||
console.log('International Numbers in Phone, it should get error'); | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Phone9',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'25416325147') | |||||
console.log('11 Numbers in Phone, it should get error'); | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
}) | |||||
test.describe('TC_Phone',()=>{ | |||||
test('Address1',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'') | |||||
console.log('Empty address, it should get error'); | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Address2',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'hriweahkjfnriufhkjfmndsbajhadgsifhkdbjkf,uhgjhdfvuyjmnhbfuj') | |||||
console.log('Excessive length address, it should get error'); | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Address3',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'$%^#&#&* main road pabnagdui') | |||||
console.log('Excessive Special characters, it should get error'); | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
}) | |||||
test.describe('TC_Company Name',()=>{ | |||||
test('CompanyName1',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'') | |||||
console.log('Empty Company Name, it should get error'); | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('CompanyName2',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic12345') | |||||
console.log('Numbers with Company Name, it should get error'); | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('CompanyName3',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'jhvfraufgjkbafkjhkjbfiabhfkjbfailshfrkbikfuakjbnfbhasgkifjab') | |||||
console.log('1000 Alphabets, it should get error'); | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('CompanyName4',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'mobigic#$%tY&') | |||||
console.log('Company Name with special characters and symbols, it should get error'); | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
}) | |||||
test.describe('TC_BusinessType',()=>{ | |||||
test('Business1',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'SweetMart'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('BusinessType was selected'); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Business2',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'FruitMart'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('BusinessType was selected'); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Business3',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'BisleriSupply'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('BusinessType was selected'); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Business4',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'Others'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('BusinessType was selected'); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
}) | |||||
test.describe('TC_City',()=>{ | |||||
test('City1',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'BisleriSupply'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
console.log('City was selected'); | |||||
await page.fill("//input[@id='oba_signup_password']",'#12345678A') | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
}) | |||||
test.describe('TC_Password',()=>{ | |||||
test('Password1',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'BisleriSupply'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'#1234') | |||||
console.log('Password is too short, it will show error'); | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Password2',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'BisleriSupply'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'12361234') | |||||
console.log('Password missing required characters, it will show error'); | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Password3',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'BisleriSupply'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'##$%%^^%%^') | |||||
console.log('Password with only special characters, it will show error'); | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
test('Password4',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Register Here ?']") | |||||
await page.fill("//input[@id='oba_signup_username']",'Micheal Rabi') | |||||
await page.fill("//input[@id='oba_signup_emailid']",'rabisundaram@gmail.com') | |||||
await page.locator("#oba_signup_phone_code").selectOption({label:'India(91)'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_phone']",'9600520046') | |||||
await page.fill("//textarea[@id='oba_signup_address']",'Panagudi, Tirunelveli TamilNadu') | |||||
await page.fill("//input[@id='oba_signup_company_name']",'Mobigic Technologies') | |||||
await page.locator("//select[@id='oba_signup_business']").selectOption({label:'BisleriSupply'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.locator("//select[@id='oba_signup_city']").selectOption({label:'Madurai'}); | |||||
await page.waitForTimeout(5000); | |||||
await page.fill("//input[@id='oba_signup_password']",'##$ wwer%%^^%%^') | |||||
console.log('Password with space, it will show error'); | |||||
await page.click(" //button[normalize-space()='SIGN UP']") | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
}) | |||||
test.describe('TC_ForgotPassword',()=>{ | |||||
test('ForgotPassword',async ({page})=>{ | |||||
await page.goto('https://jaicrm1.orderbookings.com/login/'); | |||||
await page.click("//a[normalize-space()='Forgot Password ?']") | |||||
console.log('Forgot Password button is working'); | |||||
await page.close(); | |||||
}) | |||||
}) | |||||
@ -0,0 +1,948 @@ | |||||
const {test, expect} =require('@playwright/test') | |||||
import { RegisterPage } from '../pages/RegisterPage'; | |||||
/* ---------------------------------------------------TEST CASES FOR NAME--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ | |||||
test.describe('TC_Name',()=>{ | |||||
test('TC-RP-01: Name with empty space is entered',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter value for register | |||||
await register.register('', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
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.skip('TC-RP-02: Instead of names, Numbers is entered',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('52658954623', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_username']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test.skip('TC-RP-03: 50 characters are entered',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('dhjdgabjfbdiuafhdkjbaiughjfkshloadfishjkfglik', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_username']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test.skip('TC-RP-04: Merchant enters special characters and symbol',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('^%$#%$^&*&', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_username']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-05: Name with Alphabet',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Mano', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible();//already verified again sign up will be displayed. | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-06: Name with space',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Mano Aravind', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); //already verified again sign up will be displayed. | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-07: Name with special character',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Mano_Aravind', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); //already verified again sign up will be displayed. | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-08: Names with accented characters',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Ôôerwed', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
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('TC-RP-10: Email with empty space',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', '','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_emailid']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-11: Email without @',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'rabisundaramgmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_emailid']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-12: Email without domain',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'rabisundaram@.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_emailid']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test.skip('TC-RP-13: Invalid email format',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', ' asfg@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_emailid']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test.skip('TC-RP-14: Invalid email domain',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'asfg@asfg.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_emailid']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-15: Email with invalid characters',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'user!@.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_emailid']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test.skip('TC-RP-16: Email with Excessive length',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'userudgjhbdsayiujhgbkujhgvbvkujyhgdsakhgjvkdjf!@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_emailid']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-17: Email with consecutive dots',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'manoaravcind...com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_emailid']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-19: Email with subdomain ',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'example@gmail.example.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test.skip('TC-RP-20: Email with special character in local part',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-21: Email with uppercase characters',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-23: Email with special characters only',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', '^&#^*($*$(*%','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_emailid']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
// functionality doubt | |||||
test.skip('TC-RP-24: Email with Upper case letter',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'RABISUNDARAM@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_emailid']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-25: Email with numbers only',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', '5484564525','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_emailid']"); | |||||
await expect(locator).toBeFocused(); | |||||
await expect(locator).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
}) | |||||
//-------------------------------------------------TEST CASE FOR PHONE FIELD----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ | |||||
test.describe('TC_Phone',()=>{ | |||||
test('TC-RP-26: Phone number with 10 characters',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','asdfghjklk','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_phone']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-27: Phone number with Special characters',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','%$%^%^&&*','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_phone']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-28: Phone with Alphabets',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','ASDFGHJK','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_phone']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-29: Phone with 11 numbers',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','96005200465','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_phone']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-30: Phone with 9 numbers',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','960052004','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_phone']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-31: Phone with starting with space',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'akshay.vasav@gmail.com',' 960052004','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_phone']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-32: Phone number empty',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'akshay.vasav@gmail.com',' ','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_phone']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-33: Phone with International number',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','123453678798','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_phone']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-36: Phone number with 10 numbers',async ({page})=>{ | |||||
//Go to register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter The value in register page | |||||
await register.register('Micheal Rabi', 'akshay.vasav@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
}) | |||||
//--------------------------------- TEST CASE FOR ADDRESS FIELD -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |||||
test.describe('TC_Address',()=>{ | |||||
test('TC-RP-37: Empty address',async ({page})=>{ | |||||
// Go to Register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter value for Register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//textarea[@id='oba_signup_address']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
}) | |||||
// Need to check showing error | |||||
test.skip('TC-RP-38: Exccesive length address',async ({page})=>{ | |||||
// Go to Register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter value for Register | |||||
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'); | |||||
//Assertion | |||||
const locator = page.locator("//textarea[@id='oba_signup_address']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
}) | |||||
test.skip('TC-RP-39: Except & all other alphanumeric',async ({page})=>{ | |||||
// Go to Register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter value for Register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','#$@#^%$#@main road','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//textarea[@id='oba_signup_address']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-40: Valid Address',async ({page})=>{ | |||||
// Go to Register Page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter value for Register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
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('TC-RP-43: Company name is empty',async ({page})=>{ | |||||
//navigate to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//enter value in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', '', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
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.skip('TC-RP-44: Company name with numbers',async ({page})=>{ | |||||
//go to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//enter values in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic 12345', 'SweetMart', 'Balurghat'); | |||||
//assertion | |||||
const locator = page.locator("//input[@id='oba_signup_company_name']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
}) | |||||
test.skip('TC-RP-45: Company name with 1000 Alphabets',async ({page})=>{ | |||||
//go to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter values in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'sarhjkfgbdsiugfjksdauygasjbiuadsgbjhsdbauifgadsjhbfuifgj', 'SweetMart', 'Balurghat'); | |||||
//assertion | |||||
const locator = page.locator("//input[@id='oba_signup_company_name']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
}) | |||||
test.skip('TC-RP-46: Company name with special characters symbols',async ({page})=>{ | |||||
//go to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter values in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic@1234', 'SweetMart', 'Balurghat'); | |||||
//assertion | |||||
const locator = page.locator("//input[@id='oba_signup_company_name']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-49: Company name with special characters '-' is acceptable',async ({page})=>{ | |||||
//Navigate to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter values in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram - panagudi ','#12345678A' ,'India(91)', 'Mobigic-Technology', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
}) | |||||
//------------------------------------- TEST CASES FOR BUSINESS MART -----------------------------------------------------------------------------*/ | |||||
test.describe('TC_BusinessType',()=>{ | |||||
test('TC-RP-50: SweetMart Selection',async ({page})=>{ | |||||
//Navigate to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter values in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic-Technology', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-51: Fruitmart Selection',async ({page})=>{ | |||||
//Navigate to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter values in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic-Technology', 'FruitMart', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-52: Bisleri supply selection',async ({page})=>{ | |||||
//Navigate to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter values in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic-Technology', 'BisleriSupply', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-53: Others Selection',async ({page})=>{ | |||||
//Navigate to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter values in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
}) | |||||
//------------------------------------- TEST CASES FOR Password -----------------------------------------------------------------------------*/ | |||||
test.describe('TC_Password',()=>{ | |||||
test('TC-RP-56: minimum 8 length password',async ({page})=>{ | |||||
//Navigate to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter values in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#123456' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_password']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
await page.close(); | |||||
}) | |||||
test.skip('TC-RP-57: Password entered with 25 characters',async ({page})=>{ | |||||
//Navigate to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter values in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','dsojarlgpojldm905432kjbnk' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_password']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-59: Password with upper and lower case',async ({page})=>{ | |||||
//Navigate to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter values in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#ADgrdomi' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
//password is space, 25 characters, only special characters are accepted. need to check functions | |||||
test.skip('TC-RP-60: Password with space',async ({page})=>{ | |||||
//Navigate to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter values in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#123 456' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_password']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
await page.close(); | |||||
}) | |||||
test('TC-RP-61: Too short Password is not accepted',async ({page})=>{ | |||||
//Navigate to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter values in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','1' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); | |||||
//Assertion | |||||
const locator = page.locator("//input[@id='oba_signup_password']"); | |||||
await expect(locator).toBeFocused(); | |||||
await page.close(); | |||||
await page.close(); | |||||
}) | |||||
}) | |||||
test.skip('TC-RP-63: Password with only special character',async ({page})=>{ | |||||
//Navigate to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter values in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#%^$%^&&**' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); | |||||
//Assertion | |||||
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('TC-RP-55: City Selection',async ({page})=>{ | |||||
//Navigate to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter values in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#1234567A' ,'India(91)', 'Mobigic-Technology', 'Others', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
}) | |||||
//------------------------------------- TEST CASE FOR ALREADY SIGNUP BUTTON ------------------------------------------------------------------------------------------------------------------------------------ | |||||
test('TC-RP-65: Already sign up ', async ({page}) =>{ | |||||
//Navigate to register | |||||
const register = new RegisterPage(page); | |||||
await register.alreadySignUpCheck(); | |||||
//Assertion | |||||
const locator = page.locator("//input[@name='oba_login_emailid']"); | |||||
await expect(locator).toBeFocused(); | |||||
}) | |||||
//------------------------------------ TEST CASE FOR COUNTRY CODE ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |||||
test('TC-RP-66: India Country code',async ({page})=>{ | |||||
//Navigate to register | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter value in register | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi ','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
/* -------------------------- TEST CASE FOR VALID DETAILS --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ | |||||
test.describe('GroupWithCorrectDetails',()=>{ | |||||
// Register Link Check | |||||
test('TC-RP-68: RegisterLink Check',async ({page})=>{ | |||||
//Go to register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Assertion | |||||
await expect(await page.locator("//button[@class='btn btn-primary btn-block']")).toBeVisible(); | |||||
}) | |||||
// Register with correct details | |||||
test('TC-Rp-67: Register page entering with correct details',async ({page})=>{ | |||||
//Navigate to Register page | |||||
const register = new RegisterPage(page); | |||||
await register.gotoRegisterPage(); | |||||
//Enter value in register page | |||||
await register.register('Micheal Rabi', 'rabisundaram@gmail.com','9600520046','Thalavaipuram panagudi','#12345678A' ,'India(91)', 'Mobigic Technologies', 'SweetMart', 'Balurghat'); | |||||
//Assertion | |||||
await expect(await page.locator("//button[normalize-space()='Sign UP']")).toBeVisible(); | |||||
await page.close(); | |||||
}) | |||||
}) | |||||
@ -0,0 +1,23 @@ | |||||
const {test, expect} =require('@playwright/test') | |||||
import { LoginPage } from '../pages/LoginPage'; | |||||
import { RunnerListPage } from '../pages/RunnerListPage'; | |||||
test('TC-RP-01: RunnerList Button is working?',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to Runner Page | |||||
const runner = new RunnerListPage(page); | |||||
await runner.clickrunnerListButton(); | |||||
await page.waitForTimeout(5000); | |||||
//Assertions | |||||
await expect(await page.locator("//span[@class='flip-indecator']")).toBeVisible(); | |||||
}) |
@ -0,0 +1,64 @@ | |||||
const {test, expect} =require('@playwright/test') | |||||
import { LoginPage } from '../pages/LoginPage'; | |||||
import { UserPage } from '../pages/UserPage'; | |||||
//User button is working?(In Regression Suite) | |||||
test('TC-UP-01: User Button is working',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to User Page | |||||
const user = new UserPage(page); | |||||
await user.userPageButton(); | |||||
await page.waitForTimeout(5000); | |||||
//Assertions | |||||
await expect(await page.locator("//span[@class='flip-indecator']")).toBeVisible(); | |||||
}) | |||||
//Assertions is not done(In Regression Suite) | |||||
test.skip('TC-UP-02: Active user Button check',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to user page | |||||
const user = new UserPage(page); | |||||
await user.activeUserButtonCheck(); | |||||
await page.waitForTimeout(5000); | |||||
}) | |||||
//Search Button Check(In regression suite) | |||||
test('TC-UP-03: Search Button Check',async ({page})=>{ | |||||
//Navigate to Login Page | |||||
const login = new LoginPage(page); | |||||
await login.gotoLoginPage(); | |||||
await login.loginWithCrtPassword(); | |||||
await page.waitForTimeout(5000); | |||||
//Navigate to user page | |||||
const user = new UserPage(page); | |||||
await user.searchUserValidation('DAYA'); | |||||
await page.waitForTimeout(5000); | |||||
//Assertion | |||||
await expect(await page.locator("//td[normalize-space()='DAYA']")).toBeVisible(); | |||||
}) |