Browse Source

need to correct Commit

OBA_Micheal
Micheal 7 months ago
parent
commit
89e8ac285d
30 changed files with 1819 additions and 1367 deletions
  1. +0
    -17
      pages/AddressListAPI.js
  2. +2
    -2
      pages/AppConfig.js
  3. +2
    -14
      pages/CatlogPage.js
  4. +4
    -1
      pages/ContentPage.js
  5. +3
    -11
      pages/Couponpage.js
  6. +2
    -0
      pages/Feedback.js
  7. +9
    -4
      pages/LoginPage.js
  8. +4
    -87
      pages/NotificationPage.js
  9. +15
    -20
      pages/OrderPage.js
  10. +44
    -36
      pages/ProductPage.js
  11. +6
    -8
      pages/RegisterPage.js
  12. +4
    -0
      pages/RunnerListPage.js
  13. +0
    -0
      pages/TestData/Biriyani.jpg
  14. +0
    -0
      pages/TestData/Chicken Lollipop.jpg
  15. +0
    -0
      pages/TestData/Tandori.jpg
  16. +18
    -18
      pages/UserPage.js
  17. +4
    -4
      playwright.config.js
  18. +151
    -227
      tests/APITest.spec.js
  19. +157
    -164
      tests/AppConfig.spec.js
  20. +34
    -45
      tests/CatlogPage.spec.js
  21. +29
    -25
      tests/ContentPage.spec.js
  22. +8
    -43
      tests/CouponPage.spec.js
  23. +13
    -19
      tests/Feedback.spec.js
  24. +92
    -36
      tests/LoginPage.spec.js
  25. +7
    -3
      tests/NotificationPage.spec.js
  26. +54
    -22
      tests/OrderPage.spec.js
  27. +622
    -418
      tests/ProductPage.spec.js
  28. +485
    -136
      tests/RegisterPage.spec.js
  29. +10
    -3
      tests/RunnerList.spec.js
  30. +40
    -4
      tests/UserPage.spec.js

+ 0
- 17
pages/AddressListAPI.js View File

@ -1,17 +0,0 @@
exports.AddressListAPI=
class AddressListAPI {
constructor(page) {
this.page = page;
this.addressLine="//div[normalize-space()='Address : 37, Thomas Mount, 627109']";
}
async clickCatalogButton(){
await this.page.locator(this.catlogButton).click();
}
}

+ 2
- 2
pages/AppConfig.js View File

@ -3,6 +3,7 @@ class AppConfig {
constructor(page) { constructor(page) {
this.page = page; this.page = page;
this.onOffButton="//div[@class='card is_shop_open_card']//span[@class='flip-indecator']"; this.onOffButton="//div[@class='card is_shop_open_card']//span[@class='flip-indecator']";
this.appConfLink="//span[normalize-space()='AppConfig']"; this.appConfLink="//span[normalize-space()='AppConfig']";
this.appconfIsShopOpen="//label[normalize-space()='Is Shop Open ?']"; this.appconfIsShopOpen="//label[normalize-space()='Is Shop Open ?']";
@ -13,7 +14,7 @@ class AppConfig {
this.deliveryCharge="//label[@id='oba_appconfig_delivery_charge_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.callToAction="//input[@id='oba_appconfig_call_to_action']";
this.areaSelection="//select[@id='oba_appconfig_city_selection_list']"; this.areaSelection="//select[@id='oba_appconfig_city_selection_list']";
// this.areaSelection=".form-control col-3 mt-4";
this.typingText="//input[@id='oba_appconfig_area_selection']"; this.typingText="//input[@id='oba_appconfig_area_selection']";
this.selectedText="//select[@id='oba_appconfig_area_selection_list']"; this.selectedText="//select[@id='oba_appconfig_area_selection_list']";
@ -61,7 +62,6 @@ class AppConfig {
await this.page.locator(this.typingText).fill(text); await this.page.locator(this.typingText).fill(text);
await this.page.waitForTimeout(5000); await this.page.waitForTimeout(5000);
await this.page.locator(this.movingTypingText).click(); await this.page.locator(this.movingTypingText).click();
// await this.page.waitForTimeout(5000);
await this.page.locator(this.saveButton).click(); await this.page.locator(this.saveButton).click();
} }
async toggleButton() async toggleButton()


+ 2
- 14
pages/CatlogPage.js View File

@ -47,17 +47,6 @@ class CatlogPage {
} }
async clickCatalogButton(){ async clickCatalogButton(){
await this.page.locator(this.catlogButton).click(); await this.page.locator(this.catlogButton).click();
@ -108,7 +97,6 @@ class CatlogPage {
}); });
let isActive = await this.page.locator(this.islive).isChecked(); let isActive = await this.page.locator(this.islive).isChecked();
// Productsincluded = await this.page.locator(this.productincluded).textContent();
return{catnames,selecteddcattype,selecctedprodtype,isActive,merchatcode} return{catnames,selecteddcattype,selecctedprodtype,isActive,merchatcode}
} }
@ -131,7 +119,7 @@ class CatlogPage {
return element.options[element.selectedIndex].value; return element.options[element.selectedIndex].value;
}); });
let isActive = await this.page.locator(this.islive).isChecked(); let isActive = await this.page.locator(this.islive).isChecked();
// Productsincluded = await this.page.locator(this.productincluded).textContent();
return{ catnames,selecteddcattype,selecctedprodtype,isActive,merchatcode} return{ catnames,selecteddcattype,selecctedprodtype,isActive,merchatcode}
} }
@ -153,7 +141,7 @@ class CatlogPage {
}); });
let isActive = await this.page.locator(this.islive).isChecked(); let isActive = await this.page.locator(this.islive).isChecked();
// Productsincluded = await this.page.locator(this.productincluded).textContent();
return{ catnames,selecteddcattype,selecctedprodtype,isActive,merchatcode} return{ catnames,selecteddcattype,selecctedprodtype,isActive,merchatcode}
} }


+ 4
- 1
pages/ContentPage.js View File

@ -9,13 +9,16 @@ class ContentPage {
this.contentText="//div[@class='CodeMirror-scroll']"; this.contentText="//div[@class='CodeMirror-scroll']";
this.contentSave="//button[normalize-space()='Save']"; this.contentSave="//button[normalize-space()='Save']";
} }
async clickContentButton(){ async clickContentButton(){
await this.page.locator(this.contentButton).click(); await this.page.locator(this.contentButton).click();
} }
async ContentToSave(contentToEditOption){ async ContentToSave(contentToEditOption){
await this.page.locator(this.contentButton).click(); await this.page.locator(this.contentButton).click();
await this.page.locator(this.contentToEdit).selectOption({label:contentToEditOption}); await this.page.locator(this.contentToEdit).selectOption({label:contentToEditOption});
//await this.page.locator(this.contentText).fill(mainContent);
await this.page.waitForSelector('.CodeMirror'); await this.page.waitForSelector('.CodeMirror');
await this.page.evaluate(() => { await this.page.evaluate(() => {
const codeMirrorElement = document.querySelector('.CodeMirror'); const codeMirrorElement = document.querySelector('.CodeMirror');


+ 3
- 11
pages/Couponpage.js View File

@ -25,22 +25,15 @@ class CouponPage {
this.internalCouponValueGuest="//td[normalize-space()='dFkhI6142']"; this.internalCouponValueGuest="//td[normalize-space()='dFkhI6142']";
this.couponCodeGuest="//td[normalize-space()='Christmas30']"; this.couponCodeGuest="//td[normalize-space()='Christmas30']";
this.forUsersGuest="//tbody/tr[6]/td[5]"; this.forUsersGuest="//tbody/tr[6]/td[5]";
} }
async CalenderCheck(){ async CalenderCheck(){
await this.page.locator(this.couponButton).click(); await this.page.locator(this.couponButton).click();
await this.page.locator(this.createCouponButton).click(); await this.page.locator(this.createCouponButton).click();
// await this.page.locator(this.couponButton).click();
await this.page.locator(this.calenderSelect).click(); await this.page.locator(this.calenderSelect).click();
//await page.waitForTimeout(5000);
const year ="2024"; const year ="2024";
const month ="11"; const month ="11";
const date="3"; const date="3";
@ -48,7 +41,6 @@ class CouponPage {
} }
async viewCoupon(){ async viewCoupon(){
await this.page.locator(this.couponButton).click(); await this.page.locator(this.couponButton).click();
// await page.waitForTimeout(5000);
await this.page.locator(this.viewCouponButton).click(); await this.page.locator(this.viewCouponButton).click();
} }


+ 2
- 0
pages/Feedback.js View File

@ -13,6 +13,8 @@ class Feedback {
this.phone="//td[normalize-space()='919480111111']"; this.phone="//td[normalize-space()='919480111111']";
} }
async clickFeedbackButton(){ async clickFeedbackButton(){
await this.page.locator(this.feedbackButton).click(); await this.page.locator(this.feedbackButton).click();
} }

+ 9
- 4
pages/LoginPage.js View File

@ -15,7 +15,6 @@ class LoginPage {
} }
async login(username, password){ async login(username, password){
await this.page.locator(this.usernameInput).fill(username); await this.page.locator(this.usernameInput).fill(username);
await this.page.locator(this.passwordInput).fill(password); await this.page.locator(this.passwordInput).fill(password);
await this.page.locator(this.signinButton).click(); await this.page.locator(this.signinButton).click();
@ -26,13 +25,19 @@ class LoginPage {
async loginWithCrtPassword(){ async loginWithCrtPassword(){
await this.page.fill(this.usernameInput,'xpcv2@rustyload.com'); await this.page.fill(this.usernameInput,'xpcv2@rustyload.com');
// await this.page.fill(this.usernameInput,'rabisundaram@gmail.com');
await this.page.locator(this.passwordInput).fill('7777777777'); await this.page.locator(this.passwordInput).fill('7777777777');
// await this.page.locator(this.passwordInput).fill('#12345678A');
await this.page.locator(this.signinButton).click(); 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(){ async forgetPasswordLink(){
await this.page.locator(this.forgotPassword).click(); await this.page.locator(this.forgotPassword).click();


+ 4
- 87
pages/NotificationPage.js View File

@ -2,43 +2,6 @@ const { clear } = require("console");
exports.NotificationPage= exports.NotificationPage=
class NotificationPage { class NotificationPage {
/*
constructor(page) {
this.page = page;
this.notificationButton="//span[normalize-space()='Notification']";
this.target = "//select[@id='notification_target']";
this.title = "//input[@id='notificationtitle']";
this.content = "//textarea[@id='notificationtext']";
this.hours = "//select[@id='notification_hours']";
this.minutes="//select[@id='notification_minutes']";
this.scheduleNotification="//main[@class='app-content']//button[1]";
this.sendNotification="//button[2]"
this.calenderSelector="//input[@id='notification_date']";
this.monthYear='October 2024';
this.calenderNext="//div[@class='datepicker-days']//th[@class='next'][normalize-space()='»']";
}
async datePicker(){
await this.page.locator(this.notificationButton).click();
//const year="2024";
//const month="November";
//const date="5";
await this.page.locator(this.calenderSelector).click();
const yearMonth = "January 2025"
const currentYearMonth=await this.page.locator('this.monthYear').textContent();
while(true)
{
const currentYearMonth=await this.page.locator('this.monthYear').textContent().toString();
if(currentYearMonth == yearMonth )
{
break;
}
await this.page.locator(this.calenderNext).click();
}
}
}
*/
constructor(page) constructor(page)
{ {
@ -73,13 +36,6 @@ constructor(page)
this.chooseFile ="//input[@id='notificationimage']"; this.chooseFile ="//input[@id='notificationimage']";
//Whole Notification Check
} }
@ -87,8 +43,7 @@ constructor(page)
//Check notification page
async notificationPageCheck(){ async notificationPageCheck(){
await this.page.locator(this.notificationButtonCheck).click(); await this.page.locator(this.notificationButtonCheck).click();
@ -122,7 +77,7 @@ async wholeNotificationSetting(SelectType,TitleName,UserName,TextArea,year,month
await this.page.locator( this.content).fill(TextArea); await this.page.locator( this.content).fill(TextArea);
// await this.page.locator(this.NotifyButton).click();
await this.page.locator(this.calendar).click(); await this.page.locator(this.calendar).click();
// Wait for year selection // Wait for year selection
while (true) while (true)
@ -231,38 +186,6 @@ async setTime(Hour, Min)
//send notification based on the area //send notification based on the area
async NotifyMewithArea(SelectType,TitleName,Area,TextArea){ async NotifyMewithArea(SelectType,TitleName,Area,TextArea){
await this.page.locator(this.NotifyButton).click(); await this.page.locator(this.NotifyButton).click();
@ -419,15 +342,7 @@ async scheduleNotification (){
} }
if (!dayFound) throw new Error('Day selection failed.'); if (!dayFound) throw new Error('Day selection failed.');
// File Upload
// await this.page.locator(this.chooseFile).setInputFiles(filePath);
// console.log('Attached file:', filePath);
// Set Time
// 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);
// Schedule Notification // Schedule Notification
await this.page.locator(this.scheduleNotificationButton).waitFor({ state: 'visible' }); await this.page.locator(this.scheduleNotificationButton).waitFor({ state: 'visible' });
@ -442,6 +357,7 @@ async scheduleNotification (){
} }
} }
//set file
async selectFile(filePath) { async selectFile(filePath) {
try { try {
await this.page.locator(this.NotifyButton).click(); await this.page.locator(this.NotifyButton).click();
@ -452,6 +368,7 @@ async selectFile(filePath) {
} }
} }
//set time
async setTime(Hour, Min) { async setTime(Hour, Min) {
try { try {
await this.page.locator(this.hours).selectOption(Hour); await this.page.locator(this.hours).selectOption(Hour);


+ 15
- 20
pages/OrderPage.js View File

@ -48,49 +48,47 @@ this.orderIdCancel="//div[normalize-space()='order_id : 670e240e14f563f755f3e2a4
this.orderRate="//tbody/tr[3]/td[8]"; this.orderRate="//tbody/tr[3]/td[8]";
} }
//Click Order button
async clickOrdersButton(){ async clickOrdersButton(){
await this.page.locator(this.ordersButton).click(); await this.page.locator(this.ordersButton).click();
} }
//Click order list button
async clickOrdersListButton(){ async clickOrdersListButton(){
await this.page.locator(this.ordersButton).click(); await this.page.locator(this.ordersButton).click();
//await page.waitForTimeout(5000);
await this.page.locator(this.ordersListButton).click(); await this.page.locator(this.ordersListButton).click();
} }
//Check order status
async orderStatusCheck(orderStatus){ async orderStatusCheck(orderStatus){
await this.page.locator(this.ordersButton).click(); await this.page.locator(this.ordersButton).click();
//await page.waitForTimeout(5000);
await this.page.locator(this.ordersListButton).click(); await this.page.locator(this.ordersListButton).click();
await this.page.locator(this.orderStatus).selectOption({label:orderStatus}); await this.page.locator(this.orderStatus).selectOption({label:orderStatus});
// await page.waitForTimeout(5000);
} }
//Check filter button
async checkFilterButton(orderStatus){ async checkFilterButton(orderStatus){
await this.page.locator(this.ordersButton).click(); await this.page.locator(this.ordersButton).click();
//await page.waitForTimeout(5000);
await this.page.locator(this.ordersListButton).click(); await this.page.locator(this.ordersListButton).click();
await this.page.locator(this.orderStatus).selectOption({label:orderStatus}); await this.page.locator(this.orderStatus).selectOption({label:orderStatus});
// await page.waitForTimeout(5000);
await this.page.locator(this.filterButton).click(); await this.page.locator(this.filterButton).click();
} }
//Search text
async textBoxSearch(orderStatus, textBox){ async textBoxSearch(orderStatus, textBox){
await this.page.locator(this.ordersButton).click(); await this.page.locator(this.ordersButton).click();
//await page.waitForTimeout(5000);
await this.page.locator(this.ordersListButton).click(); await this.page.locator(this.ordersListButton).click();
await this.page.locator(this.orderStatus).selectOption({label:orderStatus}); await this.page.locator(this.orderStatus).selectOption({label:orderStatus});
// await page.waitForTimeout(5000);
await this.page.locator(this.textBox).fill(textBox); await this.page.locator(this.textBox).fill(textBox);
await this.page.locator(this.filterButton).click(); await this.page.locator(this.filterButton).click();
} }
//search order
async searchOrder(orderStatus,username){ async searchOrder(orderStatus,username){
await this.page.locator(this.OrderStatus).selectOption(orderStatus); // add order status 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.usernameTextbox).fill(username); // add user name
@ -104,15 +102,12 @@ this.orderIdCancel="//div[normalize-space()='order_id : 670e240e14f563f755f3e2a4
const Order_latestupdate =await this.page.locator(this.orderlatestUpdate).textContent(); //get oder latest update 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 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} return {OrderId,OrderStatusis,Order_cost,Order_items,Order_price,Order_payment,Order_latestupdate,Order_qty}
// returning all those values.
} }
} }

+ 44
- 36
pages/ProductPage.js View File

@ -3,6 +3,9 @@ class ProductPage {
constructor(page) { constructor(page) {
this.page = page; this.page = page;
//Locators for Product Page
this.productsButton = "//span[normalize-space()='Products']"; this.productsButton = "//span[normalize-space()='Products']";
this.productListButton= "//a[normalize-space()='Product List']"; this.productListButton= "//a[normalize-space()='Product List']";
this.addProductButton="//a[normalize-space()='Add Product']"; this.addProductButton="//a[normalize-space()='Add Product']";
@ -21,42 +24,48 @@ class ProductPage {
this.uploadImage="#oba_product_input_display"; this.uploadImage="#oba_product_input_display";
this.productlistSearchBox="//input[@id='oba_product_search']"; this.productlistSearchBox="//input[@id='oba_product_search']";
this.searchBox="//i[@class='fa fa-lg fa-fw fa-search']"; this.searchBox="//i[@class='fa fa-lg fa-fw fa-search']";
this.editButton="//i[@class='fa fa-lg fa-edit']"; 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.saveButton="//button[@class='btn btn-primary btn-block']";
this.deleteButton="//i[@class='fa fa-lg fa-trash']"; this.deleteButton="//i[@class='fa fa-lg fa-trash']";
this.searchProduct="//input[@id='oba_product_search']"; this.searchProduct="//input[@id='oba_product_search']";
this.searchButton="//button[@id='oba_product_search_btn']"; this.searchButton="//button[@id='oba_product_search_btn']";
//API Validation
//API
this.nameAPI="//td[normalize-space()='T-Shirt']"; this.nameAPI="//td[normalize-space()='T-Shirt']";
this.priceAPI="//b[normalize-space()='200']"; this.priceAPI="//b[normalize-space()='200']";
this.quantityAPI="//td[normalize-space()='79971']"; this.quantityAPI="//td[normalize-space()='79971']";
this.availableAPI="//td[normalize-space()='true']"; this.availableAPI="//td[normalize-space()='true']";
this.orderlimitAPI="//td[normalize-space()='100']"; 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(){ async clickProductsButton(){
await this.page.locator(this.productsButton).click(); await this.page.locator(this.productsButton).click();
} }
//Check ProductListButton
async clickProductlistButton(){ async clickProductlistButton(){
await this.page.locator(this.productsButton).click(); await this.page.locator(this.productsButton).click();
await this.page.locator(this.productListButton).click(); await this.page.locator(this.productListButton).click();
} }
//Check Add Product Button
async clickAddProductButton(){ async clickAddProductButton(){
await this.page.locator(this.productsButton).click(); await this.page.locator(this.productsButton).click();
await this.page.locator(this.addProductButton).click(); await this.page.locator(this.addProductButton).click();
} }
//Complete Add Product Functionality
async addProductFunctionality(productName, productPrize, productQuantity, orderLimitvalue, taxin, shortDescription){ async addProductFunctionality(productName, productPrize, productQuantity, orderLimitvalue, taxin, shortDescription){
await this.page.locator(this.productsButton).click(); await this.page.locator(this.productsButton).click();
@ -77,9 +86,14 @@ class ProductPage {
}); });
await this.page.locator(this.productImage).click(); await this.page.locator(this.productImage).click();
await this.page.locator(this.uploadImage).setInputFiles("C:/Automate Testing/OBA Automation/Biriyani.jpg");
await this.page.locator(this.uploadImage).setInputFiles("./pages/TestData/Biriyani.jpg");
await this.page.locator(this.saveButton).click(); await this.page.locator(this.saveButton).click();
} }
// Add Product functionality and delete it
async addProductFunctionalityDelete(productName, productPrize, productQuantity, orderLimitvalue, taxin, shortDescription){ async addProductFunctionalityDelete(productName, productPrize, productQuantity, orderLimitvalue, taxin, shortDescription){
await this.page.locator(this.productsButton).click(); await this.page.locator(this.productsButton).click();
@ -96,13 +110,16 @@ class ProductPage {
await this.page.waitForSelector('.CodeMirror'); await this.page.waitForSelector('.CodeMirror');
await this.page.evaluate(() => { await this.page.evaluate(() => {
const codeMirrorElement = document.querySelector('.CodeMirror'); const codeMirrorElement = document.querySelector('.CodeMirror');
codeMirrorElement.CodeMirror.setValue('Yummy! Delicious Biriyani Taste the Beauty of Kanyakumari');
codeMirrorElement.CodeMirror.setValue('Yummy! Delicious Taste, LifteTime Settlement');
}); });
await this.page.locator(this.productImage).click(); await this.page.locator(this.productImage).click();
await this.page.locator(this.uploadImage).setInputFiles("C:/Automate Testing/OBA Automation/Biriyani.jpg");
await this.page.locator(this.uploadImage).setInputFiles("./pages/TestData/Biriyani.jpg");
await this.page.locator(this.deleteButton).click(); await this.page.locator(this.deleteButton).click();
} }
async addProductFunctionalityForAll(productName, productPrize, productQuantity, orderLimitvalue, taxin, shortDescription){ async addProductFunctionalityForAll(productName, productPrize, productQuantity, orderLimitvalue, taxin, shortDescription){
await this.page.locator(this.productsButton).click(); await this.page.locator(this.productsButton).click();
@ -121,9 +138,6 @@ class ProductPage {
const codeMirrorElement = document.querySelector('.CodeMirror'); const codeMirrorElement = document.querySelector('.CodeMirror');
codeMirrorElement.CodeMirror.setValue('Yummy! Delicious Taste, LifteTime Settlement'); codeMirrorElement.CodeMirror.setValue('Yummy! Delicious Taste, LifteTime Settlement');
}); });
//await this.page.locator(this.productImage).click();
// await this.page.locator(this.uploadImage).setInputFiles("C:/Automate Testing/OBA Automation/Biriyani.jpg");
await this.page.locator(this.saveButton).click(); await this.page.locator(this.saveButton).click();
} }
@ -135,8 +149,6 @@ class ProductPage {
await this.page.locator(this.unmanagedRadioButton).check(); await this.page.locator(this.unmanagedRadioButton).check();
await this.page.locator(this.orderLimit).fill(orderLimitvalue); await this.page.locator(this.orderLimit).fill(orderLimitvalue);
await this.page.locator(this.taxIn).fill(taxin); 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.locator(this.shortDescription).fill(shortDescription);
await this.page.waitForSelector('.CodeMirror'); await this.page.waitForSelector('.CodeMirror');
await this.page.evaluate(() => { await this.page.evaluate(() => {
@ -145,7 +157,7 @@ class ProductPage {
}); });
await this.page.locator(this.productImage).click(); await this.page.locator(this.productImage).click();
await this.page.locator(this.uploadImage).setInputFiles("C:/Automate Testing/OBA Automation/Tandori.jpg");
await this.page.locator(this.uploadImage).setInputFiles("./pages/TestData/Tandori.jpg");
await this.page.locator(this.saveButton).click(); await this.page.locator(this.saveButton).click();
} }
@ -165,14 +177,15 @@ class ProductPage {
await this.page.waitForSelector('.CodeMirror'); await this.page.waitForSelector('.CodeMirror');
await this.page.evaluate(() => { await this.page.evaluate(() => {
const codeMirrorElement = document.querySelector('.CodeMirror'); const codeMirrorElement = document.querySelector('.CodeMirror');
codeMirrorElement.CodeMirror.setValue('Chicken Lollipop');
codeMirrorElement.CodeMirror.setValue('Yummy! Delicious Taste, LifteTime Settlement');
}); });
await this.page.locator(this.productImage).click(); await this.page.locator(this.productImage).click();
await this.page.locator(this.uploadImage).setInputFiles("C:/Automate Testing/OBA Automation/Chicken Lollipop.jpg");
await this.page.locator(this.uploadImage).setInputFiles("./pages/TestData/Chicken Lollipop.jpg");
await this.page.locator(this.saveButton).click(); await this.page.locator(this.saveButton).click();
} }
//Working of Search Product Button
async searchProductName(productName){ async searchProductName(productName){
await this.page.locator(this.productsButton).click(); await this.page.locator(this.productsButton).click();
await this.page.locator(this.productListButton).click(); await this.page.locator(this.productListButton).click();
@ -180,30 +193,25 @@ class ProductPage {
await this.page.locator(this.searchButton).click(); await this.page.locator(this.searchButton).click();
} }
//Working of Edit Button
async editProduct(){ async editProduct(){
await this.page.locator(this.productsButton).click(); await this.page.locator(this.productsButton).click();
await this.page.locator(this.productListButton).click(); await this.page.locator(this.productListButton).click();
await this.page.locator(this.editButton).click();
await this.page.locator(this.edittButton).click();
await this.page.locator(this.productAvailableCheck).click(); await this.page.locator(this.productAvailableCheck).click();
await this.page.locator(this.saveButton).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();
}
} }

+ 6
- 8
pages/RegisterPage.js View File

@ -2,6 +2,7 @@ exports.RegisterPage = class RegisterPage {
constructor(page) { constructor(page) {
this.page =page; this.page =page;
this.registerHereLink="//a[normalize-space()='Register Here ?']"; this.registerHereLink="//a[normalize-space()='Register Here ?']";
this.name="//input[@id='oba_signup_username']"; this.name="//input[@id='oba_signup_username']";
this.email="//input[@id='oba_signup_emailid']"; this.email="//input[@id='oba_signup_emailid']";
@ -15,12 +16,15 @@ exports.RegisterPage = class RegisterPage {
this.signupButton=" //button[normalize-space()='SIGN UP']"; this.signupButton=" //button[normalize-space()='SIGN UP']";
this.alreadysignupLink="//a[normalize-space()='Already Sign Up ?']"; this.alreadysignupLink="//a[normalize-space()='Already Sign Up ?']";
} }
//Navigate to Register Page
async gotoRegisterPage(){ async gotoRegisterPage(){
await this.page.goto('https://dev.orderbookings.com/login/'); await this.page.goto('https://dev.orderbookings.com/login/');
await this.page.locator(this.registerHereLink).click(); await this.page.locator(this.registerHereLink).click();
} }
//Check Alreagy sign up working?
async alreadySignUpCheck(){ async alreadySignUpCheck(){
await this.page.goto('https://dev.orderbookings.com/login/'); await this.page.goto('https://dev.orderbookings.com/login/');
await this.page.locator(this.registerHereLink).click(); await this.page.locator(this.registerHereLink).click();
@ -30,27 +34,21 @@ exports.RegisterPage = class RegisterPage {
//Complete functionality to register
async register(name, email, phoneNumber, address, password,phoneCode, companyName, businessType, city){ async register(name, email, phoneNumber, address, password,phoneCode, companyName, businessType, city){
await this.page.locator(this.name).fill(name); await this.page.locator(this.name).fill(name);
await this.page.locator(this.email).fill(email); await this.page.locator(this.email).fill(email);
await this.page.locator(this.phoneCode).selectOption({label:phoneCode}); await this.page.locator(this.phoneCode).selectOption({label:phoneCode});
//await page.waitForTimeout(5000);
await this.page.locator(this.phoneNumber).fill(phoneNumber); await this.page.locator(this.phoneNumber).fill(phoneNumber);
await this.page.locator(this.address).fill(address); await this.page.locator(this.address).fill(address);
await this.page.locator(this.companyName).fill(companyName); await this.page.locator(this.companyName).fill(companyName);
await this.page.locator(this.businessType).selectOption({label:businessType}); await this.page.locator(this.businessType).selectOption({label:businessType});
//await page.waitForTimeout(5000);
await this.page.locator(this.city).selectOption({label:city}); await this.page.locator(this.city).selectOption({label:city});
//await page.waitForTimeout(5000);
await this.page.locator(this.password).fill(password); await this.page.locator(this.password).fill(password);
await this.page.locator(this.signupButton).click(); await this.page.locator(this.signupButton).click();
//await page.waitForTimeout(5000);
// console.log('Successfully Registered');
// console.log('Email is registered successfully and mail is sent');
// await page.close();
} }

+ 4
- 0
pages/RunnerListPage.js View File

@ -3,12 +3,16 @@ class RunnerListPage {
constructor(page) { constructor(page) {
this.page = page; this.page = page;
//LOcators for runner list page
this.runnerListButton="//span[normalize-space()='Runner list']"; this.runnerListButton="//span[normalize-space()='Runner list']";
this.userTypeFlip="//span[@class='flip-indecator']"; this.userTypeFlip="//span[@class='flip-indecator']";
this.searchText="//input[@id='oba_user_search']"; this.searchText="//input[@id='oba_user_search']";
this.searchButton="//button[@id='oba_user_search_btn']"; this.searchButton="//button[@id='oba_user_search_btn']";
} }
//Runnerlist Button working?
async clickrunnerListButton(){ async clickrunnerListButton(){
await this.page.locator(this.runnerListButton).click(); await this.page.locator(this.runnerListButton).click();
} }

Biriyani.jpg → pages/TestData/Biriyani.jpg View File


Chicken Lollipop.jpg → pages/TestData/Chicken Lollipop.jpg View File


Tandori.jpg → pages/TestData/Tandori.jpg View File


+ 18
- 18
pages/UserPage.js View File

@ -5,7 +5,9 @@ class UserPage {
this.page = page; this.page = page;
this.Users = "//span[normalize-space()='Users']"; this.Users = "//span[normalize-space()='Users']";
this.activeUserButton = "//span[@class='flip-indecator']"; this.activeUserButton = "//span[@class='flip-indecator']";
this.searchUser="//input[@id='oba_user_search']";
this.enableButton = "//button[@id='66eaa9656b2f4a3d52a42549']"; this.enableButton = "//button[@id='66eaa9656b2f4a3d52a42549']";
this.filterButton="//button[@id='oba_user_search_btn']";
//AssertionForAPI //AssertionForAPI
this.userNameAPI="//td[normalize-space()='DAYA']"; this.userNameAPI="//td[normalize-space()='DAYA']";
@ -16,49 +18,47 @@ class UserPage {
//Assertion for address //Assertion for address
this.addressList="//td[normalize-space()='35, Mount Main Road , Tamil Nadu, 123111']"; 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']"; this.addressPatch="//td[normalize-space()='35, Mount Kitchen Main Road, Tamil Nadu, 123111']";
} }
//UserPage Button Validation
async userPageButton(){ async userPageButton(){
await this.page.locator(this.Users).click(); await this.page.locator(this.Users).click();
} }
//Validate active user button Check
async activeUserButtonCheck(){ async activeUserButtonCheck(){
await this.page.locator(this.Users).click(); await this.page.locator(this.Users).click();
await this.page.locator(this.activeUserButton).click(); await this.page.locator(this.activeUserButton).click();
// const text =await this.page.locator("button:active").allInnerTexts();
console.log(text);
} }
//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(){ async activeUserButtonEdit(){
await this.page.locator(this.Users).click(); await this.page.locator(this.Users).click();
await this.page.locator(this.activeUserButton).click(); await this.page.locator(this.activeUserButton).click();
await this.page.locator(this.enableButton).click(); await this.page.locator(this.enableButton).click();
} }
//Navigate to user page in API for user details
async userAPI(){ async userAPI(){
await this.page.locator(this.Users).click(); await this.page.locator(this.Users).click();
} }
//Navigate to user page in API for address
async addressListAPI(){ async addressListAPI(){
await this.page.locator(this.Users).click(); await this.page.locator(this.Users).click();
} }
} }

+ 4
- 4
playwright.config.js View File

@ -38,10 +38,10 @@ module.exports = defineConfig({
use: { ...devices['Desktop Chrome'] }, use: { ...devices['Desktop Chrome'] },
}, },
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
// {
// name: 'firefox',
// use: { ...devices['Desktop Firefox'] },
// },
//{ //{
// name: 'webkit', // name: 'webkit',


+ 151
- 227
tests/APITest.spec.js View File

@ -7,70 +7,66 @@ import { UserPage } from '../pages/UserPage';
import { CatlogPage } from '../pages/CatlogPage'; import { CatlogPage } from '../pages/CatlogPage';
import { ProductPage } from '../pages/ProductPage'; 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
/*----------------------------------------OrderID Complete Check-------------------------------------------*/
const baseURL="https://dev.orderbookings.com/api";
test('Get Orders-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')//base uri should maintan separately
console.log(await response.json())
//expect(response.status()).toBe(200) //dont put commented code in repo
// const text = await response.text(); //its better to give discription for the steps you are following in comments
// expect(text).toContain('Manju') //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 res = await response.json();
// 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); const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
// Navigate to order page and search
const order = new OrderPage(page); const order = new OrderPage(page);
const result = await order.textBoxSearch('ORDER_STATUS_COMPLETE', 'Shubya');
// await page.waitForTimeout(5000);
//const username= result.OrderId;
//expect.soft("//td[normalize-space()='Shubya']").toContain(res.data[0].ordered_by_name);
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());
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()); expect.soft(order.orderQty).toContain((res.data[0].ordered_items_qty[0]).toString());
}) })
/*---------------------------------------------App Config----------------------------------------------------*/
//Validate App Config Page (In regression suite)
test('TC-API-11: complete AppConfig page to check API',async ({page,request})=>{
test('complete AppConfig page to check API',async ({page,request})=>{
// Navigate to login page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
// Navigate to App Config Page
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('UAE dirham (د.إ;)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('UAE dirham (د.إ;)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
// await page.close();
const response = await request.get('https://dev.orderbookings.com/api/config/919480707707?merchantCode=919480707707')
console.log(await response.json())
//get request and response
const response = await request.get(baseURL+'/config/919480707707?merchantCode=919480707707');
const res = await response.json(); const res = await response.json();
//await page.close();
//await login.gotoLoginPage();
// await login.loginWithCrtPassword();
// await config.openAppConf();
//Assertions
expect.soft(config.merchantCode).toContain(res.data.merchantCode); 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).toString();
//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(); const cancellationTillResponse = await page.locator(config.cancellationTillAPI).inputValue();
expect.soft(cancellationTillResponse).toContain((res.data.cancellation_till).toString()); expect.soft(cancellationTillResponse).toContain((res.data.cancellation_till).toString());
@ -80,107 +76,115 @@ test('complete AppConfig page to check API',async ({page,request})=>{
const deliveryChargeResponse = await page.locator(config.deliveryChargeAPI).inputValue(); const deliveryChargeResponse = await page.locator(config.deliveryChargeAPI).inputValue();
expect.soft( deliveryChargeResponse).toContain((res.data.delivery_charge).toString()); expect.soft( deliveryChargeResponse).toContain((res.data.delivery_charge).toString());
// expect.soft(config.areaSelection).toContain((res.data.area_type).toString());
}) })
/*----------------------------------------------Coupon---------------------------------------------------*/
test('APITesting_Coupon Get Details as User',async ({request,page})=>{
const response = await request.get('https://dev.orderbookings.com/api/available-coupon/670e14cf14f563f755f3e2a1/919480707707')
console.log(await response.json())
//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(); const res = await response.json();
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Navigate to coupon page
const coupon = new CouponPage(page); const coupon = new CouponPage(page);
await coupon.viewCoupon(); await coupon.viewCoupon();
//Assertions
expect.soft(coupon.shortDescription).toContain(res.data[1].name); expect.soft(coupon.shortDescription).toContain(res.data[1].name);
expect.soft(coupon.descriptionCheck).toContain(res.data[1].description); expect.soft(coupon.descriptionCheck).toContain(res.data[1].description);
expect.soft(coupon.internalCouponValue).toContain(res.data[1].code); expect.soft(coupon.internalCouponValue).toContain(res.data[1].code);
expect.soft(coupon.couponCode).toContain(res.data[1].campaign_code); expect.soft(coupon.couponCode).toContain(res.data[1].campaign_code);
// expect.soft(coupon.forUsers).toContain(res.data[0].for);
}) })
//Validate Coupon details as Guest(In Regression Suite)
test('TC_API_16: APITesting_Coupon Get Details as Guest',async ({request,page})=>{
test('APITesting_Coupon Get Details as Guest',async ({request,page})=>{
const response = await request.get('https://dev.orderbookings.com/api/available-coupon-guest/919480707707')
console.log(await response.json())
//get request and response
const response = await request.get(baseURL+'/available-coupon-guest/919480707707');
const res = await response.json(); const res = await response.json();
//Navigate to login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Navigate to coupon page
const coupon = new CouponPage(page); const coupon = new CouponPage(page);
await coupon.viewCoupon(); await coupon.viewCoupon();
//Assertions
expect.soft(coupon.shortDescriptionGuest).toContain(res.data[0].name); expect.soft(coupon.shortDescriptionGuest).toContain(res.data[0].name);
expect.soft(coupon.descriptionCheckGuest).toContain(res.data[0].description); expect.soft(coupon.descriptionCheckGuest).toContain(res.data[0].description);
expect.soft(coupon.internalCouponValueGuest).toContain(res.data[0].code); expect.soft(coupon.internalCouponValueGuest).toContain(res.data[0].code);
expect.soft(coupon.couponCodeGuest).toContain(res.data[0].campaign_code); expect.soft(coupon.couponCodeGuest).toContain(res.data[0].campaign_code);
// expect.soft(coupon.forUsersGuest).toContain(res.data[0].for);
}) })
/*----------------------------------------------OrderId Pending---------------------------------------------*/
//get order by order id and compare with web ui in the order list.
test('GET ORDER BY ORDER_ID',async ({request,page})=>{
//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);
const response1 = await request.get('https://dev.orderbookings.com/api/order/getorder/670e249314f563f755f3e2a5')
console.log(await response1.json())
const res = await response1.json();
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', 'DAYA');
//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.userid).toContain(res.data.id); //id
expect.soft(order.username).toContain(res.data.ordered_by_name); //name 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.useremail).toContain(res.data.ordered_by_email); //email
expect.soft(order.userphone).toContain(res.data.ordered_by_phone); //phone expect.soft(order.userphone).toContain(res.data.ordered_by_phone); //phone
// expect.soft(order.userorderitems).toContain((res.data.ordered_items[0]).toString()); //order items
const element = await page.locator(order.userorderitems); const element = await page.locator(order.userorderitems);
const text = await element.textContent(); const text = await element.textContent();
expect(text).toContain(res.data.ordered_items[0]);
// expect.soft(order.ordercost).toContain((res.data.order_cost).toString()); //order cost is different 604 vs 654
expect(text).toContain(res.data.ordered_items[0]); //order items
expect.soft(order.orderqty).toContain((res.data.ordered_items_qty[0]).toString()); // order qty expect.soft(order.orderqty).toContain((res.data.ordered_items_qty[0]).toString()); // order qty
//expect.soft(order.userorderstatus).toContain(res.data.order_status); // order status is complete
await page.close(); await page.close();
}) })
/*---------------------------------------------------------User Details----------------------------------*/
//get order by order id and compare with web ui in the order list.
test('GET USER Details',async ({request,page})=>{
const response2 = await request.get('https://dev.orderbookings.com/api/user/userreg?phone=919480111111&merchantCode=919480707707')
console.log(await response2.json())
//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(); const res = await response2.json();
//Navigate to login page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Navigate to user page
const user = new UserPage(page); const user = new UserPage(page);
await user.userAPI(); await user.userAPI();
//Assertions
expect.soft(user.userNameAPI).toContain(res.data.name); expect.soft(user.userNameAPI).toContain(res.data.name);
expect.soft(user.userPhoneAPI).toContain(res.data.phone); expect.soft(user.userPhoneAPI).toContain(res.data.phone);
expect.soft(user.userEmailAPI).toContain(res.data.email); expect.soft(user.userEmailAPI).toContain(res.data.email);
@ -188,35 +192,30 @@ test('GET USER Details',async ({request,page})=>{
expect.soft(user.addressAPI).toContain(res.data.area[0]); 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[1]);
expect.soft(user.addressAPI).toContain(res.data.area[2]); expect.soft(user.addressAPI).toContain(res.data.area[2]);
await page.close(); await page.close();
}) })
/*--------------------------------------------------------------Get Categories and Products-----------------------------------------------*/
test('Get Categories and products',async ({page,request})=>{
//Validate Categories(In Regression Suite)
test('TC-API-12: Get Categories and products',async ({page,request})=>{
//Main Page Element locating //Main Page Element locating
const response = await request.get('https://dev.orderbookings.com/api/bud/919480707707')
console.log(await response.json())
//Get request and response
const response = await request.get(baseURL+'/bud/919480707707');
const res = await response.json(); const res = await response.json();
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Navigate to categories Page
const catlog = new CatlogPage(page); const catlog = new CatlogPage(page);
await catlog.clickCatalogButton(); await catlog.clickCatalogButton();
//Assertions
const obaBudView = page.locator('//select[@id="oba_bud_view"]'); const obaBudView = page.locator('//select[@id="oba_bud_view"]');
const obaProductView = page.locator('//select[@id="oba_product_view"]'); const obaProductView = page.locator('//select[@id="oba_product_view"]');
@ -226,17 +225,19 @@ test('GET USER Details',async ({request,page})=>{
expect.soft(budValue).toContain(res.data.buds[0].childview); expect.soft(budValue).toContain(res.data.buds[0].childview);
expect.soft(productValue).toContain(res.data.buds[0].product_childview); expect.soft(productValue).toContain(res.data.buds[0].product_childview);
// Mens Page
// Mens Page
//Navigate to Login Page
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Navigate to Catlog Page
await catlog.clickCatalogButton(); await catlog.clickCatalogButton();
let Category1 = await catlog.NavigateToMens(); let Category1 = await catlog.NavigateToMens();
//Initialize values
let Name1 = await Category1.catnames; let Name1 = await Category1.catnames;
let catlogViewType1 = await Category1.selecteddcattype; let catlogViewType1 = await Category1.selecteddcattype;
let Productviewtype1 = await Category1.selecctedprodtype; let Productviewtype1 = await Category1.selecctedprodtype;
@ -253,6 +254,7 @@ test('GET USER Details',async ({request,page})=>{
var cat3 = res.data.buds[3].name; //kids var cat3 = res.data.buds[3].name; //kids
//Assertions
expect.soft(Name1).toEqual(cat1); expect.soft(Name1).toEqual(cat1);
expect.soft(merchantid).toEqual(merchantcode) expect.soft(merchantid).toEqual(merchantcode)
expect.soft(catlogViewType1).toEqual(catlog1ViewType1); expect.soft(catlogViewType1).toEqual(catlog1ViewType1);
@ -260,7 +262,8 @@ test('GET USER Details',async ({request,page})=>{
expect.soft(Catislive1).toEqual(cat1islive); expect.soft(Catislive1).toEqual(cat1islive);
// Womens Page
// Womens Page
//Initialize values
let Category2 = await catlog.NavigateToWomens(); let Category2 = await catlog.NavigateToWomens();
@ -268,20 +271,21 @@ test('GET USER Details',async ({request,page})=>{
const catlogViewType2 = await Category2.selecteddcattype; const catlogViewType2 = await Category2.selecteddcattype;
const Productviewtype2 = await Category2.selecctedprodtype; const Productviewtype2 = await Category2.selecctedprodtype;
const Catislive2 = Category2.isActive; const Catislive2 = Category2.isActive;
console.log('For Womens' +Catislive2);
// const Catproducts2 = await Category2.Productsincluded;
let cat2logViewType =res.data.buds[2].childview; let cat2logViewType =res.data.buds[2].childview;
let cat2Productviewtype =res.data.buds[2].product_childview; let cat2Productviewtype =res.data.buds[2].product_childview;
let cat2islive = res.data.buds[2].is_live; let cat2islive = res.data.buds[2].is_live;
let merchantcode2 =res.data.buds[2].merchantCode; let merchantcode2 =res.data.buds[2].merchantCode;
//Assertions
expect.soft(Name2).toEqual(cat2); expect.soft(Name2).toEqual(cat2);
expect.soft(merchantid).toEqual(merchantcode2) expect.soft(merchantid).toEqual(merchantcode2)
expect.soft(catlogViewType2).toEqual(cat2logViewType); expect.soft(catlogViewType2).toEqual(cat2logViewType);
expect.soft(Productviewtype2).toEqual(cat2Productviewtype); expect.soft(Productviewtype2).toEqual(cat2Productviewtype);
expect.soft(Catislive2).toEqual(cat2islive); expect.soft(Catislive2).toEqual(cat2islive);
// expect.soft(Catproducts2).toEqual(res.data.buds[2].products);
//this cat3 is kids //this cat3 is kids
let Category3 = await catlog.NavigateToKids(); let Category3 = await catlog.NavigateToKids();
@ -289,47 +293,49 @@ test('GET USER Details',async ({request,page})=>{
const catlogViewType3 = await Category3.selecteddcattype; const catlogViewType3 = await Category3.selecteddcattype;
const Productviewtype3 = await Category3.selecctedprodtype; const Productviewtype3 = await Category3.selecctedprodtype;
const Catislive3 = Category3.isActive; const Catislive3 = Category3.isActive;
console.log('for kids:' +Catislive3);
//const Catproducts3 = await Category3.Productsincluded;
//api request response are in object so we need save in the letibale to compare.
let cat3ogViewType =res.data.buds[3].childview; let cat3ogViewType =res.data.buds[3].childview;
let cat3Productviewtype =res.data.buds[3].product_childview; let cat3Productviewtype =res.data.buds[3].product_childview;
let cat3islive = res.data.buds[3].is_live; let cat3islive = res.data.buds[3].is_live;
let merchantcode3 =res.data.buds[3].merchantCode; let merchantcode3 =res.data.buds[3].merchantCode;
//Assertions
expect.soft(Name3).toEqual(cat3); expect.soft(Name3).toEqual(cat3);
expect.soft(merchantid).toEqual(merchantcode3); expect.soft(merchantid).toEqual(merchantcode3);
expect.soft(catlogViewType3).toEqual(cat3ogViewType); expect.soft(catlogViewType3).toEqual(cat3ogViewType);
expect.soft(Productviewtype3).toEqual(cat3Productviewtype); expect.soft(Productviewtype3).toEqual(cat3Productviewtype);
expect.soft(Catislive3).toEqual(cat3islive); expect.soft(Catislive3).toEqual(cat3islive);
}) })
//Get products(In regression suite)
test('TC-API-12: Get Products',async ({request,page})=>{
test('Get Products',async ({request,page})=>{
const response = await request.get('https://dev.orderbookings.com/api/bud/919480707707')
console.log(await response.json())
//Get request and response
const response = await request.get(baseURL+'/bud/919480707707');
const res = await response.json(); const res = await response.json();
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Navigate to product page
const product = new ProductPage(page); const product = new ProductPage(page);
await product.clickProductlistButton(); await product.clickProductlistButton();
//Assertions
const productName = await page.textContent("//td[normalize-space()='T-Shirt']"); const productName = await page.textContent("//td[normalize-space()='T-Shirt']");
expect.soft(productName.trim()).toContain(res.data.products[0].name.trim()); expect.soft(productName.trim()).toContain(res.data.products[0].name.trim());
// expect.soft(product.nameAPI).toContain(res.data.products[0].name);
expect.soft(product.priceAPI).toContain((res.data.products[0].price).toString()); expect.soft(product.priceAPI).toContain((res.data.products[0].price).toString());
expect.soft(product.quantityAPI).toContain((res.data.products[0].quantity).toString()); expect.soft(product.quantityAPI).toContain((res.data.products[0].quantity).toString());
@ -343,9 +349,8 @@ test('Get Products',async ({request,page})=>{
}) })
/*---------------------------------------------------Address API-----------------------------------------------------------------------------------------------------*/
test('Complete Address API',async({page,request})=>{
//Complete address list process(In regression suite)
test('TC_API-02,03,01,17: Complete Address API',async({page,request})=>{
let resourceId; let resourceId;
@ -353,7 +358,7 @@ test('Complete Address API',async({page,request})=>{
// 1. Post Response // 1. Post Response
const postResponse = await request.post('https://dev.orderbookings.com/api/user/addnewaddress',{
const postResponse = await request.post(baseURL+'/user/addnewaddress',{
data: { data: {
"addressLine1": "35", "addressLine1": "35",
"addressLine2": "Mount Main Road ", "addressLine2": "Mount Main Road ",
@ -370,19 +375,22 @@ test('Complete Address API',async({page,request})=>{
}); });
//Navigate to login
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Navigate to user
const user = new UserPage(page); const user = new UserPage(page);
await user.addressListAPI(); await user.addressListAPI();
expect(postResponse.status()).toBe(200); // HTTP 200 indicates a successful creation
const postResponseBody = await postResponse.json(); // Parse the response body
console.log(postResponseBody);
expect(postResponse.status()).toBe(200);
const postResponseBody = await postResponse.json();
// Validate response body // Validate response body
expect(postResponseBody.data).toHaveProperty('id'); // Assuming the API returns an `id` for the new resource expect(postResponseBody.data).toHaveProperty('id'); // Assuming the API returns an `id` for the new resource
@ -394,31 +402,32 @@ test('Complete Address API',async({page,request})=>{
expect.soft(user.addressList).toContain(postResponseBody.data.stateOrProvince); expect.soft(user.addressList).toContain(postResponseBody.data.stateOrProvince);
expect.soft(user.addressList).toContain((postResponseBody.data.postalCode).toString()); expect.soft(user.addressList).toContain((postResponseBody.data.postalCode).toString());
// 2. Get address list
//2. Get address list
const getResponse = await request.get('https://dev.orderbookings.com/api/user/addresslist?user_id=670e14cf14f563f755f3e2a1')
console.log(await getResponse.json())
const getResponse = await request.get(baseURL+'/user/addresslist?user_id=670e14cf14f563f755f3e2a1');
const getResponseBody = await getResponse.json(); const getResponseBody = await getResponse.json();
//Navigate to Login Page
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Navigate to User Page
await user.addressListAPI(); await user.addressListAPI();
//Assertions
expect.soft(user.addressList).toContain(getResponseBody.data[1].addressLine1); 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].addressLine2);
expect.soft(user.addressList).toContain(getResponseBody.data[1].stateOrProvince); expect.soft(user.addressList).toContain(getResponseBody.data[1].stateOrProvince);
expect.soft(user.addressList).toContain((getResponseBody.data[1].postalCode).toString()); expect.soft(user.addressList).toContain((getResponseBody.data[1].postalCode).toString());
//3.Patch Request
//3.Patch Request
const patchResponse = await request.patch('https://dev.orderbookings.com/api/user/updateaddress',{
const patchResponse = await request.patch(baseURL+'/user/updateaddress',{
data: { data: {
"addressLine1": "35", "addressLine1": "35",
@ -436,16 +445,18 @@ test('Complete Address API',async({page,request})=>{
}, },
}); });
console.log(await patchResponse.json())
const patchResponseBody = await patchResponse.json(); const patchResponseBody = await patchResponse.json();
//Navigate to Login Page
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
//Navigate to user page
await user.addressListAPI(); await user.addressListAPI();
//Assertions
expect.soft(user.addressPatch).toContain(patchResponseBody.data.addressLine1); expect.soft(user.addressPatch).toContain(patchResponseBody.data.addressLine1);
expect.soft(user.addressPatch).toContain(patchResponseBody.data.addressLine2); expect.soft(user.addressPatch).toContain(patchResponseBody.data.addressLine2);
expect.soft(user.addressPatch).toContain(patchResponseBody.data.stateOrProvince); expect.soft(user.addressPatch).toContain(patchResponseBody.data.stateOrProvince);
@ -453,7 +464,7 @@ const patchResponseBody = await patchResponse.json();
// 4. Delete Request // 4. Delete Request
const deleteResponse = await request.delete('https://dev.orderbookings.com/api/user/deleteaddress', {
const deleteResponse = await request.delete(baseURL+'/user/deleteaddress', {
data:{ data:{
"user_id": "670e14cf14f563f755f3e2a1", "user_id": "670e14cf14f563f755f3e2a1",
"address_id": resourceId, "address_id": resourceId,
@ -462,18 +473,18 @@ const patchResponseBody = await patchResponse.json();
// Validate DELETE response // Validate DELETE response
expect(deleteResponse.status()).toBe(200); // Typically, HTTP 200 or 204 is expected for successful deletions expect(deleteResponse.status()).toBe(200); // Typically, HTTP 200 or 204 is expected for successful deletions
const deleteResponseBody = await deleteResponse.text(); // Some APIs may not return JSON for DELETE
console.log('DELETE response:', deleteResponseBody);
const deleteResponseBody = await deleteResponse.text();
}) })
test('Post and Delete Address API',async({page,request})=>{
test('TC-API-03,17: Post and Delete Address API',async({request})=>{
// 1. Post Response // 1. Post Response
const postResponse = await request.post('https://dev.orderbookings.com/api/user/addnewaddress',{
const postResponse = await request.post(baseURL+'/user/addnewaddress',{
data: { data: {
"addressLine1": "52", "addressLine1": "52",
"addressLine2": "25", "addressLine2": "25",
@ -490,9 +501,9 @@ test('Post and Delete Address API',async({page,request})=>{
}); });
expect(postResponse.status()).toBe(200); // HTTP 201 indicates a successful creation
expect(postResponse.status()).toBe(200);
const postResponseBody = await postResponse.json(); // Parse the response body const postResponseBody = await postResponse.json(); // Parse the response body
console.log(postResponseBody);
// Validate response body // Validate response body
expect(postResponseBody.data).toHaveProperty('id'); // Assuming the API returns an `id` for the new resource expect(postResponseBody.data).toHaveProperty('id'); // Assuming the API returns an `id` for the new resource
@ -501,7 +512,7 @@ test('Post and Delete Address API',async({page,request})=>{
// 2. Delete Request // 2. Delete Request
const deleteResponse = await request.delete('https://dev.orderbookings.com/api/user/deleteaddress', {
const deleteResponse = await request.delete(baseURL+'/user/deleteaddress', {
data:{ data:{
"user_id": "670e14cf14f563f755f3e2a1", "user_id": "670e14cf14f563f755f3e2a1",
"address_id": resourceId, "address_id": resourceId,
@ -509,98 +520,11 @@ test('Post and Delete Address API',async({page,request})=>{
}); });
// Validate DELETE response // Validate DELETE response
expect(deleteResponse.status()).toBe(200); // Typically, HTTP 200 or 204 is expected for successful deletions
const deleteResponseBody = await deleteResponse.text(); // Some APIs may not return JSON for DELETE
console.log('DELETE response:', deleteResponseBody);
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 //Order Page cannot be automated, since the API datas are missing, as it is continued from place order, products are missing
/*
test('Cancel Order API',async({page,request})=>{
const postResponse = await request.post('https://dev.orderbookings.com/api/order/cancelorder',{
"order_id":"670e240e14f563f755f3e2a4"
});
// const login = new LoginPage(page);
// await login.gotoLoginPage();
// await login.loginWithCrtPassword();
// await page.waitForTimeout(5000);
// const order = new OrderPage(page);
// await order.checkFilterButton('ORDER_STATUS_CANCELLED');
expect(postResponse.status()).toBe(200); // HTTP 201 indicates a successful creation
const postResponseBody = await postResponse.json(); // Parse the response body
// expect.soft(user.orderIdCancel).toContain(postResponseBody.order_id);
console.log(postResponseBody);
})
test('Post Rate Order Address API',async({page,request})=>{
//place an order
//Complete an order
// Post Response
const postResponse = await request.post('https://dev.orderbookings.com/api/order/rateOrder',{
data: {
"order_id": "67076b44272db54e96e423eb",
"rating":4,
"fcm_token":"kjdfhkdbshigkmadniuaghkk"
},
});
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
const order = new OrderPage(page);
await order.checkFilterButton('ORDER_STATUS_COMPLETE');
expect(postResponse.status()).toBe(200); // HTTP 201 indicates a successful creation
const postResponseBody = await postResponse.json(); // Parse the response body
console.log(postResponseBody);
expect.soft(order.orderID).toContain(postResponseBody.order_id); //id
expect.soft(order.orderRate).toContain(postResponseBody.rating); //name
await page.close();
})
*/

+ 157
- 164
tests/AppConfig.spec.js View File

@ -2,102 +2,68 @@ const {test, expect} =require('@playwright/test')
import { LoginPage } from '../pages/LoginPage'; import { LoginPage } from '../pages/LoginPage';
import { AppConfig } from '../pages/AppConfig'; import { AppConfig } from '../pages/AppConfig';
test('AppConfig button is working or not',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
const config = new AppConfig(page);
await config.openAppConf();
await page.waitForTimeout(3000)
await expect(await page.locator(config.notificationSoundLoop)).toBeVisible();
})
test.beforeEach(async ({ page }) => {
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
});
test.skip('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('UAE dirham (د.إ;)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
//Merchant Verify that the selected currency symbol is displayed correctly(In Regression Suite)
test('TC-AC-02: Select as Indonesian rupiah (Rp)', async ({page}) =>{
await page.close();
//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();
});
const response = await request.get('https://dev.orderbookings.com/api/config/919480707707?merchantCode=919480707707')
console.log(await response.json())
const res = await response.json();
//(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.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
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.areaSelection).toContain(res.data.area_type);
})
await page.waitForTimeout(5000);
//Navigate to App Config Oage
const config = new AppConfig(page);
await config.openAppConf();
/*-------------------------------------------------Currency Check-----------------------------------*/
await page.waitForTimeout(3000)
//Merchant Verify that the selected currency symbol is displayed correctly
test('Select as Indonesian rupiah (Rp)', async ({page}) =>{
//Assertions
await expect(await page.locator(config.notificationSoundLoop)).toBeVisible();
})
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("//select[@id='oba_appconfig_select_currency']");
await expect(locator).toContainText('Indonesian rupiah (Rp)');
await page.waitForTimeout(1000);
await page.close();
});
/*-----------------------------Call to Action------------------------------------------------*/ /*-----------------------------Call to Action------------------------------------------------*/
//Call To Action for empty
//Call To Action for empty (In Regression Suite)
test.skip('Action call for empty ',async ({page})=>{ test.skip('Action call for empty ',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '', 'City','Tamil Nadu');
// const locator = page.getByRole('Action Call');
// await expect(locator).toBeFocused();
// await page.waitForTimeout(3000);
await page.close();
await page.close();
}); });
//Call To Action contains numbers starting with 23 //Call To Action contains numbers starting with 23
test('Action contains numbers starting with 23 ',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
test('TC-AC-05: Action contains numbers starting with 23 ',async ({page})=>{
//Navigate to config Page
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '2355456737', 'City','Tamil Nadu'); 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']"); const locator = page.locator("//input[@id='oba_appconfig_call_to_action']");
await expect(locator).toBeFocused(); await expect(locator).toBeFocused();
await expect(locator).toBeVisible(); await expect(locator).toBeVisible();
@ -106,12 +72,13 @@ test.skip('complete AppConfig page to check API',async ({page,request})=>{
}); });
//Call To Action for Letters //Call To Action for Letters
test('Call To Action for Letters',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
test('TC-AC-06: Call To Action for Letters',async ({page})=>{
//Navigate to Config Page
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', 'AFHGDGJNBVJ', 'City','Tamil Nadu'); 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']"); const locator = page.locator("//input[@id='oba_appconfig_call_to_action']");
await expect(locator).toBeFocused(); await expect(locator).toBeFocused();
await expect(locator).toBeVisible(); await expect(locator).toBeVisible();
@ -120,12 +87,13 @@ test.skip('complete AppConfig page to check API',async ({page,request})=>{
}); });
//Call to Action only 9 numbers //Call to Action only 9 numbers
test('Call to Action only 9 numbers' ,async({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
test('TC-AC-07: Call to Action only 9 numbers' ,async({page})=>{
//Navigate to config page
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '956456737', 'City','Tamil Nadu'); 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']"); const locator = page.locator("//input[@id='oba_appconfig_call_to_action']");
await expect(locator).toBeFocused(); await expect(locator).toBeFocused();
await expect(locator).toBeVisible(); await expect(locator).toBeVisible();
@ -134,12 +102,13 @@ test.skip('complete AppConfig page to check API',async ({page,request})=>{
}) })
//call to action using specail chars //call to action using specail chars
test('call to action using specail characters', async({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
test('TC-AC-08: call to action using special characters', async({page})=>{
//Navigate to App Configuration Page
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '95#5456737', 'City','Tamil Nadu'); 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']"); const locator = page.locator("//input[@id='oba_appconfig_call_to_action']");
await expect(locator).toBeFocused(); await expect(locator).toBeFocused();
await expect(locator).toBeVisible(); await expect(locator).toBeVisible();
@ -148,12 +117,13 @@ test.skip('complete AppConfig page to check API',async ({page,request})=>{
}) })
//call to Action using Space //call to Action using Space
test('space for action call',async({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
test('TC-AC-09: space for action call',async({page})=>{
//Navigate to App Configuration Page
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', ' 965 526 ', 'City','Tamil Nadu'); 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']"); const locator = page.locator("//input[@id='oba_appconfig_call_to_action']");
await expect(locator).toBeFocused(); await expect(locator).toBeFocused();
await expect(locator).toBeVisible(); await expect(locator).toBeVisible();
@ -162,12 +132,13 @@ test.skip('complete AppConfig page to check API',async ({page,request})=>{
}); });
//Merchant add International Number //Merchant add International Number
test('International Number', async({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
test('TC-AC-10: International Number', async({page})=>{
//Navigate to App Configuration Page
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '456236216514', 'City','Tamil Nadu'); 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']"); const locator = page.locator("//input[@id='oba_appconfig_call_to_action']");
await expect(locator).toBeFocused(); await expect(locator).toBeFocused();
await expect(locator).toBeVisible(); await expect(locator).toBeVisible();
@ -176,25 +147,27 @@ test.skip('complete AppConfig page to check API',async ({page,request})=>{
}) })
test('Enter Alphabet', async({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
test('TC-AC-11: Enter Alphabet', async({page})=>{
//Navigate to App Configuration Page
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', 'hjgfdjsfjk', 'City','Tamil Nadu'); 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']"); const locator = page.locator("//input[@id='oba_appconfig_call_to_action']");
await expect(locator).toBeFocused(); await expect(locator).toBeFocused();
await expect(locator).toBeVisible(); await expect(locator).toBeVisible();
await page.waitForTimeout(3000); await page.waitForTimeout(3000);
await page.close();
await page.close();
}) })
test('11 digits', async({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
test('TC-AC-12: 11 digits', async({page})=>{
//Navigate to App Configuration Page
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '96548712396', 'City','Tamil Nadu'); 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']"); const locator = page.locator("//input[@id='oba_appconfig_call_to_action']");
await expect(locator).toBeFocused(); await expect(locator).toBeFocused();
await expect(locator).toBeVisible(); await expect(locator).toBeVisible();
@ -202,39 +175,40 @@ test.skip('complete AppConfig page to check API',async ({page,request})=>{
await page.close(); await page.close();
}) })
test.skip('10 digits', async({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
test('TC-AC-16: 10 digits', async({page})=>{
//Navigate to App Configuration Page
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
const actionNumber = await page.locator(("//input[@id='oba_appconfig_call_to_action']").textContent());
expect.soft(actionNumber).toContain('9565456737');
//Assertions
const PhoneNumber = await page.locator("//input[@id='oba_appconfig_call_to_action']").inputValue();
expect.soft(PhoneNumber).toContain(('9565456737').toString());
await page.close(); await page.close();
}) })
//Merchant add valid details //Merchant add valid details
test.skip('Valid Number starts with 6,7,8,9',async({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
test('TC-AC-17: Valid Number starts with 6,7,8,9',async({page})=>{
//Navigate to App Configuration Page
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '6565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '6565456737', 'City','Tamil Nadu');
const actionNumber = await page.locator(("//input[@id='oba_appconfig_call_to_action']").textContent());
expect.soft(actionNumber).toContain('9565456737');
//Assertions
const actionNumber = await page.locator("//input[@id='oba_appconfig_call_to_action']").inputValue();
expect.soft(actionNumber).toContain(('6565456737').toString());
await page.waitForTimeout(2000);
await page.close(); await page.close();
}) })
//Unable to assert
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
@ -244,150 +218,162 @@ test.skip('complete AppConfig page to check API',async ({page,request})=>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
const locator = page.locator("//option[@value='CITY']"); const locator = page.locator("//option[@value='CITY']");
await expect(locator).toBeVisible(); await expect(locator).toBeVisible();
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });
//user select State //user select State
test('select State', async ({page}) =>{
test.skip('select State', async ({page}) =>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
// const App = new Appconfig(page);
//await App.Appconfigdetails('Indonesian rupiah (Rp)','5','800','20','9480606707','State','Bijapur@-12');
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });
//
//user select City //user select City
test.skip('select City', async ({page}) =>{ test.skip('select City', async ({page}) =>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
const locator = page.locator(("//option[@value='CITY']").inputValue()); const locator = page.locator(("//option[@value='CITY']").inputValue());
await expect(locator).toBeVisible(); await expect(locator).toBeVisible();
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });
//user select Pincode //user select Pincode
test('select Pincode', async ({page}) =>{
test.skip('select Pincode', async ({page}) =>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });
//user select Landmark //user select Landmark
test('select Landmark', async ({page}) =>{
test.skip('select Landmark', async ({page}) =>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });
//user select None //user select None
test('select None', async ({page}) =>{
test.skip('select None', async ({page}) =>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });
//user enter the less than cart value //user enter the less than cart value
test('less than cart value ', async ({page}) =>{
test.skip('less than cart value ', async ({page}) =>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });
//user enter the cart value equal to the value //user enter the cart value equal to the value
test('cart value equal to the value', async ({page}) =>{
test.skip('cart value equal to the value', async ({page}) =>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });
//user enter cart zero //user enter cart zero
test('enter cart zero ', async ({page}) =>{
test.skip('enter cart zero ', async ({page}) =>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });
//user enter the delivary charges as zero //user enter the delivary charges as zero
test('enter the delivary charges as zero', async ({page}) =>{
test.skip('enter the delivary charges as zero', async ({page}) =>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });
//user enter the Delivary chrages as more than given. //user enter the Delivary chrages as more than given.
test('Delivary chrages as more than given.', async ({page}) =>{
test.skip('Delivary chrages as more than given.', async ({page}) =>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });
//user enter the less cart value and add delivary charg to //user enter the less cart value and add delivary charg to
@ -395,12 +381,13 @@ test.skip('complete AppConfig page to check API',async ({page,request})=>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });
//user enter the less than cart value //user enter the less than cart value
@ -409,45 +396,49 @@ test.skip('complete AppConfig page to check API',async ({page,request})=>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '400', '35', '9565456737', 'City','Tamil Nadu');
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });
//user enter the zero as cart value and delivary charge //user enter the zero as cart value and delivary charge
test('enter the zero as cart value and delivary charge', async ({page}) =>{
test.skip('enter the zero as cart value and delivary charge', async ({page}) =>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '0', '0', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '0', '0', '9565456737', 'City','Tamil Nadu');
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });
//user enter sound loop as 0 //user enter sound loop as 0
test(' enter sound loop as 0', async ({page}) =>{
test.skip(' enter sound loop as 0', async ({page}) =>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','0','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','0','5', '400', '35', '9565456737', 'City','Tamil Nadu');
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });
//user enter sound loop as 100 //user enter sound loop as 100
test(' enter sound loop as 100', async ({page}) =>{
test.skip(' enter sound loop as 100', async ({page}) =>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','100','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','100','5', '400', '35', '9565456737', 'City','Tamil Nadu');
@ -456,11 +447,12 @@ test.skip('complete AppConfig page to check API',async ({page,request})=>{
}); });
//user enter sound loop as 10 //user enter sound loop as 10
test(' enter sound loop as 10', async ({page}) =>{
test.skip(' enter sound loop as 10', async ({page}) =>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','10','5', '400', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','10','5', '400', '35', '9565456737', 'City','Tamil Nadu');
@ -469,16 +461,17 @@ test.skip('complete AppConfig page to check API',async ({page,request})=>{
}); });
//user enter cart value to max 999999 //user enter cart value to max 999999
test('enter cart value to max 999999', async ({page}) =>{
test.skip('enter cart value to max 999999', async ({page}) =>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
const config = new AppConfig(page); const config = new AppConfig(page);
await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '999999', '35', '9565456737', 'City','Tamil Nadu'); await config.functionalityAppConfig('Indonesian rupiah (Rp)','7','5', '999999', '35', '9565456737', 'City','Tamil Nadu');
await page.waitForTimeout(3000);
await page.close();
await page.waitForTimeout(3000);
await page.close();
}); });


+ 34
- 45
tests/CatlogPage.spec.js View File

@ -4,94 +4,83 @@ import { CatlogPage } from '../pages/CatlogPage';
test.beforeEach(async ({ page }) => {
test('CatlogButton is working?',async ({page})=>{
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
});
test('TC-CP-14: CatlogButton is working?',async ({page})=>{
//Navigate to catlog page
const catlog = new CatlogPage(page); const catlog = new CatlogPage(page);
//await catlog.clickCatalogButton();
await catlog.clickCatalogButton(); await catlog.clickCatalogButton();
await page.waitForTimeout(3000) await page.waitForTimeout(3000)
//Assertion
await expect(await page.locator(catlog.catlogPageValidate)).toBeVisible(); await expect(await page.locator(catlog.catlogPageValidate)).toBeVisible();
}) })
test('Buds List is selected',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
//Not able to assert
test.skip('Buds List is selected',async ({page})=>{
//Navigate to Catlog page
const catlog = new CatlogPage(page); const catlog = new CatlogPage(page);
//await catlog.clickCatalogButton();
await catlog.imageUpload('BUDS_LIST', 'PRODUCTS_LEFT'); await catlog.imageUpload('BUDS_LIST', 'PRODUCTS_LEFT');
await page.waitForTimeout(3000) await page.waitForTimeout(3000)
}) })
test('Buds sliding is selected',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
test.skip('Buds sliding is selected',async ({page})=>{
//Navigate to Catlog page
const catlog = new CatlogPage(page); const catlog = new CatlogPage(page);
//await catlog.clickCatalogButton();
await catlog.imageUpload('BUDS_SLIDING', 'PRODUCTS_LEFT'); await catlog.imageUpload('BUDS_SLIDING', 'PRODUCTS_LEFT');
await page.waitForTimeout(3000) await page.waitForTimeout(3000)
}) })
test('Buds grid is selected',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
test.skip('Buds grid is selected',async ({page})=>{
//Navigate to Catlog page
const catlog = new CatlogPage(page); const catlog = new CatlogPage(page);
//await catlog.clickCatalogButton();
await catlog.imageUpload('BUDS_GRID', 'PRODUCTS_LEFT'); await catlog.imageUpload('BUDS_GRID', 'PRODUCTS_LEFT');
await page.waitForTimeout(3000) await page.waitForTimeout(3000)
}) })
test('product left is selected',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
test.skip('product left is selected',async ({page})=>{
//Navigate to Catlog page
const catlog = new CatlogPage(page); const catlog = new CatlogPage(page);
//await catlog.clickCatalogButton();
await catlog.imageUpload('BUDS_GRID', 'PRODUCTS_LEFT'); await catlog.imageUpload('BUDS_GRID', 'PRODUCTS_LEFT');
await page.waitForTimeout(3000) await page.waitForTimeout(3000)
}) })
test('product ping pong is selected',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
test.skip('product ping pong is selected',async ({page})=>{
//Navigate to catlog page
const catlog = new CatlogPage(page); const catlog = new CatlogPage(page);
//await catlog.clickCatalogButton();
await catlog.imageUpload('BUDS_GRID', 'PRODUCTS_PING_PONG'); await catlog.imageUpload('BUDS_GRID', 'PRODUCTS_PING_PONG');
await page.waitForTimeout(3000) await page.waitForTimeout(3000)
}) })
test('product right is selected',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
test.skip('product right is selected',async ({page})=>{
//Navigate to Catlog Page
const catlog = new CatlogPage(page); const catlog = new CatlogPage(page);
//await catlog.clickCatalogButton();
await catlog.imageUpload('BUDS_GRID', 'PRODUCTS_RIGHT'); await catlog.imageUpload('BUDS_GRID', 'PRODUCTS_RIGHT');
await page.waitForTimeout(3000) await page.waitForTimeout(3000)
}) })
test('product grid is selected',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
test.skip('product grid is selected',async ({page})=>{
//Navigate to catlog page
const catlog = new CatlogPage(page); const catlog = new CatlogPage(page);
//await catlog.clickCatalogButton();
await catlog.imageUpload('BUDS_GRID', 'PRODUCTS_GRID'); await catlog.imageUpload('BUDS_GRID', 'PRODUCTS_GRID');
await page.waitForTimeout(3000) await page.waitForTimeout(3000)

+ 29
- 25
tests/ContentPage.spec.js View File

@ -3,51 +3,55 @@ import { LoginPage } from '../pages/LoginPage';
import { ContentPage } from '../pages/ContentPage'; import { ContentPage } from '../pages/ContentPage';
test('Content page is opening?',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
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); const content = new ContentPage(page);
await content.clickContentButton(); await content.clickContentButton();
//Assertion
await expect(await page.locator(content.contentPageValidate)).toBeVisible(); await expect(await page.locator(content.contentPageValidate)).toBeVisible();
// await page.waitForTimeout(3000)
}) })
*
test('Content page is able to save in privacy policy',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
//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); const content = new ContentPage(page);
await content.ContentToSave('Privacy Policy'); await content.ContentToSave('Privacy Policy');
// await expect(await page.locator(content.contentPageValidate)).toBeVisible();
await page.waitForTimeout(3000); await page.waitForTimeout(3000);
}) })
test('Content page is able to save in Terms & Conditions',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
test.skip('Content page is able to save in Terms & Conditions',async ({page})=>{
//Navigate to content page
const content = new ContentPage(page); const content = new ContentPage(page);
await content.ContentToSave('Terms & Conditions'); await content.ContentToSave('Terms & Conditions');
// await expect(await page.locator(content.contentPageValidate)).toBeVisible();
await page.waitForTimeout(3000); await page.waitForTimeout(3000);
}) })
test('Content page is able to save in About Us',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
test.skip('Content page is able to save in About Us',async ({page})=>{
//Navigate to content page
const content = new ContentPage(page); const content = new ContentPage(page);
await content.ContentToSave('About Us'); await content.ContentToSave('About Us');
// await expect(await page.locator(content.contentPageValidate)).toBeVisible();
await page.waitForTimeout(3000); await page.waitForTimeout(3000);

+ 8
- 43
tests/CouponPage.spec.js View File

@ -3,55 +3,20 @@ import { LoginPage } from '../pages/LoginPage';
import { CouponPage } from '../pages/Couponpage'; import { CouponPage } from '../pages/Couponpage';
test('Coupon Button working?',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
const coupon = new CouponPage(page);
await coupon.viewCoupon();
await expect(await page.locator("//th[normalize-space()='Coupon Code']")).toBeVisible();
})
test('TC-COU-01: Coupon Button working?',async ({page})=>{
/*
test('APITesting_Coupon Get Details as User',async ({request,page})=>{
const response = await request.get('https://dev.orderbookings.com/api/available-coupon/670e14cf14f563f755f3e2a1/919480707707')
console.log(await response.json())
//expect(response.status()).toBe(200)
// const text = await response.text();
// expect(text).toContain('Manju')
const res = await response.json();
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.loginWithCrtPassword();
await page.waitForTimeout(5000);
const coupon = new CouponPage(page);
await coupon.viewCoupon();
expect.soft(coupon.shortDescription).toContain(res.data[2].name);
expect.soft(coupon.descriptionCheck).toContain(res.data[2].description);
expect.soft(coupon.internalCouponValue).toContain(res.data[2].code);
expect.soft(coupon.couponCode).toContain(res.data[2].campaign_code);
expect.soft(coupon.forUsers).toContain(res.data[2].for);
})
test('APITesting_Coupon Get Details as Guest',async ({request,page})=>{
const response = await request.get('https://dev.orderbookings.com/api/available-coupon-guest/919480707707')
console.log(await response.json())
const res = await response.json();
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Navigate to coupon page
const coupon = new CouponPage(page); const coupon = new CouponPage(page);
await coupon.viewCoupon(); await coupon.viewCoupon();
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);
expect.soft(coupon.forUsersGuest).toContain(res.data[0].for);
})
//Assertion
await expect(await page.locator("//th[normalize-space()='Coupon Code']")).toBeVisible();
*/
})

+ 13
- 19
tests/Feedback.spec.js View File

@ -3,18 +3,27 @@ import { LoginPage } from '../pages/LoginPage';
import { Feedback } from '../pages/Feedback'; import { Feedback } from '../pages/Feedback';
test('Feedback page is opening?',async ({page})=>{
test('TC-FP-01: Feedback page is opening?',async ({page})=>{
//NAVIGATE TO LOGIN PAGE
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//NAVIGATE TO FEEDBACK PAGE
const feedback = new Feedback(page); const feedback = new Feedback(page);
await feedback.clickFeedbackButton(); await feedback.clickFeedbackButton();
//ASSERTION
await expect(await page.locator("//label[normalize-space()='Select feedback Type']")).toBeVisible(); await expect(await page.locator("//label[normalize-space()='Select feedback Type']")).toBeVisible();
// await page.waitForTimeout(3000)
}) })
test('Submit Feedback_API',async ({request,page})=>{
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', const response = await request.post('https://dev.orderbookings.com/api/merchant/submitFeedback',
{ {
data:{ data:{
@ -27,26 +36,11 @@ test('Submit Feedback_API',async ({request,page})=>{
"feedback_from_phone": "919480111111" "feedback_from_phone": "919480111111"
} }
}); });
// 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 feedback = new Feedback(page);
await feedback.clickFeedbackButton();
expect.soft(feedback.mailID).toContain(res.feedback_from_email);
expect.soft(feedback.feedbackText).toContain(res.feedback_text);
expect.soft(feedback.name).toContain(res.feedback_from_name);
expect.soft((feedback.phone).toString()).toContain(res.feedback_from_phone); */
const res = await response.json(); const res = await response.json();
await console.log('ADDED NEW FEEDBACK OF USER');
await console.log(res);
//ASSERTION
expect(res.data).toBe(true); expect(res.data).toBe(true);
await page.reload(); await page.reload();


+ 92
- 36
tests/LoginPage.spec.js View File

@ -5,73 +5,82 @@ import { LoginPage } from '../pages/LoginPage';
//For Valid Details. //For Valid Details.
test('Login test with correct credentials',async ({page})=>{
test('TC-LP-01: Login test with correct credentials',async ({page})=>{
//Navigate to login page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.login('xpcv2@rustyload.com','7777777777') 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 expect(page).toHaveURL('https://dev.orderbookings.com/merchant/index/index'); //check the expected url is having same url
await page.close(); await page.close();
}) })
//Invalid Password
test('Login test with wrong password',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.login('rabisundaram@gmail.com','#123466678A')
await expect(await page.locator("//small[@class='text-danger text-center']")).toBeVisible(); //negative invalid email
await page.close();
})
//Invalid Username
test('Login test with wrong Email',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.login('rabisundaatram@gmail.com','#12345678A')
await expect(await page.locator("//small[@class='text-danger text-center']")).toBeVisible(); //negative invalid email
await page.close();
})
//@ Email without @ symbol //@ Email without @ symbol
test('Login test Merchant enters email without @ symbol',async ({page})=>{
test('TC-LP-03: Login test Merchant enters email without @ symbol',async ({page})=>{
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.login('rabisundaatramgmail.com','#12345678A') await login.login('rabisundaatramgmail.com','#12345678A')
await expect(await page.locator("//small[@class='text-danger text-center']")).toBeVisible(); //negative invalid email
await page.close();
})
// Email with excessive Length
test('Login test Merchant enters Email with excessive Length',async ({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 expect(await page.locator("//small[@class='text-danger text-center']")).toBeVisible(); //negative invalid email
await page.close(); await page.close();
}) })
// Email without domain // Email without domain
test('Login test Merchant enters email without domain',async ({page})=>{
test('TC-Lp-04: Login test Merchant enters email without domain',async ({page})=>{
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.login('rabisundaatram@.com','#12345678A') await login.login('rabisundaatram@.com','#12345678A')
//Assertion
await expect(await page.locator("//small[@class='text-danger text-center']")).toBeVisible(); //negative invalid email await expect(await page.locator("//small[@class='text-danger text-center']")).toBeVisible(); //negative invalid email
await page.close(); 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 //Email with consecutive dots
test('Login test Merchant enters Email with consecutive dots',async ({page})=>{
test('TC-LP-07: Login test Merchant enters Email with consecutive dots',async ({page})=>{
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.login('rabisundaatram@gmail..com','#12345678A') await login.login('rabisundaatram@gmail..com','#12345678A')
//Assertion
await expect(await page.locator("//small[@class='text-danger text-center']")).toBeVisible(); //negative invalid email await expect(await page.locator("//small[@class='text-danger text-center']")).toBeVisible(); //negative invalid email
await page.close(); await page.close();
}) })
//Empty Username //Empty Username
test('Login test with Empty Email',async ({page})=>{
test('TC-LP-08: Login test with Empty Email',async ({page})=>{
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.login('','#12345678A') await login.login('','#12345678A')
//Assertion
const locator = page.locator("//input[@name='oba_login_emailid']"); const locator = page.locator("//input[@name='oba_login_emailid']");
await expect(locator).toBeFocused(); await expect(locator).toBeFocused();
await expect(locator).toBeVisible(); await expect(locator).toBeVisible();
@ -79,46 +88,93 @@ test('Login test with Empty Email',async ({page})=>{
}) })
//Empty Password //Empty Password
test('Login test with no password',async ({page})=>{
test('TC-LP-09: Login test with no password',async ({page})=>{
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.login('rabisundaram@gmail.com','') await login.login('rabisundaram@gmail.com','')
//Assertion
const locator = page.locator("//input[@placeholder='Password']"); const locator = page.locator("//input[@placeholder='Password']");
await expect(locator).toBeFocused(); await expect(locator).toBeFocused();
await expect(locator).toBeVisible(); await expect(locator).toBeVisible();
await page.close(); 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? //Forgot Password working or not?
test('ForgotPassword',async ({page})=>{
test('TC-LP-12: ForgotPassword',async ({page})=>{
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await page.waitForTimeout(3000) await page.waitForTimeout(3000)
await login.forgetPasswordLink() await login.forgetPasswordLink()
await page.waitForTimeout(3000) await page.waitForTimeout(3000)
//Assertion
await expect(await page.locator("//button[normalize-space()='RESET']")).toBeVisible(); await expect(await page.locator("//button[normalize-space()='RESET']")).toBeVisible();
}) })
//Back To Login working? //Back To Login working?
test('BacktoLogin',async ({page})=>{
test('TC-LP-13: BacktoLogin',async ({page})=>{
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await page.waitForTimeout(3000) await page.waitForTimeout(3000)
await login.forgetPasswordLink() await login.forgetPasswordLink()
await page.waitForTimeout(3000) await page.waitForTimeout(3000)
await login.backToLoginLink() await login.backToLoginLink()
await page.waitForTimeout(3000) await page.waitForTimeout(3000)
//Assertion
await expect(await page.locator("//button[normalize-space()='SIGN IN']")).toBeVisible(); await expect(await page.locator("//button[normalize-space()='SIGN IN']")).toBeVisible();
}) })
// //
test('Invalid mail',async ({page})=>{
test('TC-LP-14: Invalid mail',async ({page})=>{
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.login('midhaja','#12345678A') await login.login('midhaja','#12345678A')
await page.waitForTimeout(3000) await page.waitForTimeout(3000)
const errorMessage = await page.locator("//div[@role='alert']").textContent()
console.log(errorMessage);
await page.locator("//div[@role='alert']").textContent()
//Assertion
await expect(await page.locator("//div[@role='alert']")).toBeVisible(); await expect(await page.locator("//div[@role='alert']")).toBeVisible();
}) })

+ 7
- 3
tests/NotificationPage.spec.js View File

@ -4,7 +4,7 @@ import { NotificationPage } from '../pages/NotificationPage';
test('Notification Button is working?',async ({page}) =>{
test('TC-NP-01: Notification Button is working?',async ({page}) =>{
//login Function //login Function
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
@ -66,11 +66,13 @@ test.skip('Duplicate NotifybyName', async ({page}) =>{
}) })
test.skip('NotifybyArea', async ({page}) =>{ test.skip('NotifybyArea', async ({page}) =>{
//login Function //login Function
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(1000); await page.waitForTimeout(1000);
//Notify Function using Send Notification by Area //Notify Function using Send Notification by Area
const Notified = new Notify(page); const Notified = new Notify(page);
await Notified.NotifyMewithArea('Send notification by Area','Shubya','586101','Successfully Added Notification by area'); await Notified.NotifyMewithArea('Send notification by Area','Shubya','586101','Successfully Added Notification by area');
@ -89,7 +91,7 @@ test.skip('check time is set',async({page})=>{
await page.waitForTimeout(1000); await page.waitForTimeout(1000);
const Notified = new Notify(page); const Notified = new Notify(page);
await Notified.NotifyMewithArea('Send notification by Area','Shubya','ABCDF','Successfully Added Notification by area'); await Notified.NotifyMewithArea('Send notification by Area','Shubya','ABCDF','Successfully Added Notification by area');
//await Notified.setDate('2025','April 2025','2'); //unable to set date in the test
await page.waitForTimeout(100); await page.waitForTimeout(100);
await Notified.setTime('8','45'); await Notified.setTime('8','45');
await page.waitForTimeout(100); await page.waitForTimeout(100);
@ -111,9 +113,12 @@ test.skip('check Send Notification',async({page})=>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(1000); await page.waitForTimeout(1000);
const dash = new DashBoard(page); const dash = new DashBoard(page);
await dash.gotoNotification() await dash.gotoNotification()
const Notified = new Notify(page); const Notified = new Notify(page);
await Notified.sendNotification(); await Notified.sendNotification();
await page.close(); await page.close();
@ -127,7 +132,6 @@ test.skip('check file selected',async({page})=>{
await page.waitForTimeout(1000); await page.waitForTimeout(1000);
const Notified = new Notify(page); const Notified = new Notify(page);
await Notified.selectFile('C:/PlayWright/files/SS.jpeg'); await Notified.selectFile('C:/PlayWright/files/SS.jpeg');
//await expect(page.locator('#notificationimage')).toBeAttached();
await Notified.sendNotification(); await Notified.sendNotification();
await page.close(); await page.close();
}) })

+ 54
- 22
tests/OrderPage.spec.js View File

@ -4,89 +4,125 @@ import { LoginPage } from '../pages/LoginPage';
import { OrderPage } from '../pages/OrderPage'; import { OrderPage } from '../pages/OrderPage';
test('Order Button',async ({page})=>{
test('TC-OP-01: Order Button',async ({page})=>{
//Navigate to login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Navigate to order page
const order = new OrderPage(page); const order = new OrderPage(page);
await order.clickOrdersButton(); await order.clickOrdersButton();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Assertion
await expect(await page.locator("//a[normalize-space()='Order List']")).toBeVisible(); await expect(await page.locator("//a[normalize-space()='Order List']")).toBeVisible();
}) })
test('Order List Button',async ({page})=>{
test('Tc-OP-02: Order List Button',async ({page})=>{
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Navigate to Order Page
const order = new OrderPage(page); const order = new OrderPage(page);
await order.clickOrdersListButton(); await order.clickOrdersListButton();
// await page.waitForTimeout(5000);
//Assertion
await expect(await page.locator("//select[@id='oba_edit_order_status_filter']")).toBeVisible(); await expect(await page.locator("//select[@id='oba_edit_order_status_filter']")).toBeVisible();
}) })
test('Order Status Dropdown Count',async ({page})=>{
test('TC-OP-03: Order Status Dropdown Count',async ({page})=>{
//Navigate to login page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Navigate to order page
const order = new OrderPage(page); const order = new OrderPage(page);
await order.clickOrdersListButton(); await order.clickOrdersListButton();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Assertion
const options = await page.locator('#oba_edit_order_status_filter option') const options = await page.locator('#oba_edit_order_status_filter option')
await expect(options).toHaveCount(5); await expect(options).toHaveCount(5);
}) })
test('Order status dropdown menu',async ({page})=>{
test.skip('Order status dropdown menu',async ({page})=>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
// await page.waitForTimeout(5000);
const order = new OrderPage(page); const order = new OrderPage(page);
await order.clickOrdersListButton(); await order.clickOrdersListButton();
// await page.waitForTimeout(5000);
const value= await page.locator("//select[@id='oba_edit_order_status_filter']").textContent() const value= await page.locator("//select[@id='oba_edit_order_status_filter']").textContent()
console.log(value); console.log(value);
}) })
test('Order status selected',async ({page})=>{
test.skip('Order status selected',async ({page})=>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
//await page.waitForTimeout(5000);
const order = new OrderPage(page); const order = new OrderPage(page);
await order.orderStatusCheck('ORDER_STATUS_REQUESTED'); await order.orderStatusCheck('ORDER_STATUS_REQUESTED');
//need to fi
}) })
test('Order declined',async ({page})=>{
test.skip('Order declined',async ({page})=>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
const order = new OrderPage(page); const order = new OrderPage(page);
await order.textBoxSearch('ORDER_STATUS_DECLINED', 'Tomato Rice and Chicken Biriyani'); await order.textBoxSearch('ORDER_STATUS_DECLINED', 'Tomato Rice and Chicken Biriyani');
}) })
test('Order requested',async ({page})=>{
test.skip('Order requested',async ({page})=>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
const order = new OrderPage(page); const order = new OrderPage(page);
await order.textBoxSearch('ORDER_STATUS_REQUESTED', 'Tomato Rice and Chicken Biriyani'); await order.textBoxSearch('ORDER_STATUS_REQUESTED', 'Tomato Rice and Chicken Biriyani');
}) })
test('Order pending',async ({page})=>{
test.skip('Order pending',async ({page})=>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
const order = new OrderPage(page); const order = new OrderPage(page);
await order.textBoxSearch('ORDER_STATUS_PENDING', 'Tomato Rice and Chicken Biriyani'); await order.textBoxSearch('ORDER_STATUS_PENDING', 'Tomato Rice and Chicken Biriyani');
}) })
test('Order cancelled',async ({page})=>{
test.skip('Order cancelled',async ({page})=>{
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
const order = new OrderPage(page); const order = new OrderPage(page);
await order.textBoxSearch('ORDER_STATUS_CANCELLED', 'Tomato Rice and Chicken Biriyani'); await order.textBoxSearch('ORDER_STATUS_CANCELLED', 'Tomato Rice and Chicken Biriyani');
@ -95,13 +131,11 @@ test('Order cancelled',async ({page})=>{
}) })
test('Order by ID API',async ({request,page})=>{
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 response = await request.get('https://dev.orderbookings.com/api/order/syncOrders?user_id=670766e4272db54e96e423e0&phone=919480111222&lastupdatetime=0&merchantCode=919480707707&role=ROLE_TYPE_MERCHANT')
console.log(await response.json())
//expect(response.status()).toBe(200)
// const text = await response.text();
// expect(text).toContain('Manju')
const res = await response.json(); const res = await response.json();
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
@ -109,9 +143,7 @@ test('Order by ID API',async ({request,page})=>{
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
const order = new OrderPage(page); const order = new OrderPage(page);
const result = await order.textBoxSearch('ORDER_STATUS_COMPLETE', 'Shubya'); const result = await order.textBoxSearch('ORDER_STATUS_COMPLETE', 'Shubya');
// await page.waitForTimeout(5000);
//const username= result.OrderId;
//expect.soft("//td[normalize-space()='Shubya']").toContain(res.data[0].ordered_by_name);
expect.soft(order.orderName).toContain(res.data[0].ordered_by_name); 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.orderEmail).toContain(res.data[0].ordered_by_email);
expect.soft(order.orderPhone).toContain((res.data[0].ordered_by_address.phone).toString()); expect.soft(order.orderPhone).toContain((res.data[0].ordered_by_address.phone).toString());


+ 622
- 418
tests/ProductPage.spec.js
File diff suppressed because it is too large
View File


+ 485
- 136
tests/RegisterPage.spec.js
File diff suppressed because it is too large
View File


+ 10
- 3
tests/RunnerList.spec.js View File

@ -3,14 +3,21 @@ import { LoginPage } from '../pages/LoginPage';
import { RunnerListPage } from '../pages/RunnerListPage'; import { RunnerListPage } from '../pages/RunnerListPage';
test('RunnerList Button is working?',async ({page})=>{
test('TC-RP-01: RunnerList Button is working?',async ({page})=>{
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Navigate to Runner Page
const runner = new RunnerListPage(page); const runner = new RunnerListPage(page);
await runner.clickrunnerListButton(); await runner.clickrunnerListButton();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Assertions
await expect(await page.locator("//span[@class='flip-indecator']")).toBeVisible(); await expect(await page.locator("//span[@class='flip-indecator']")).toBeVisible();
//await page.locator("//span[@class='flip-indecator']").waitFor({ state: 'visible' });
})
})

+ 40
- 4
tests/UserPage.spec.js View File

@ -2,27 +2,63 @@ const {test, expect} =require('@playwright/test')
import { LoginPage } from '../pages/LoginPage'; import { LoginPage } from '../pages/LoginPage';
import { UserPage } from '../pages/UserPage'; import { UserPage } from '../pages/UserPage';
//User button is working?(In Regression Suite)
test('TC-UP-01: User Button is working',async ({page})=>{
test('User Button is working',async ({page})=>{
//Navigate to Login Page
const login = new LoginPage(page); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Navigate to User Page
const user = new UserPage(page); const user = new UserPage(page);
await user.userPageButton(); await user.userPageButton();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Assertions
await expect(await page.locator("//span[@class='flip-indecator']")).toBeVisible(); await expect(await page.locator("//span[@class='flip-indecator']")).toBeVisible();
}) })
test('Active user Button check',async ({page})=>{
//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); const login = new LoginPage(page);
await login.gotoLoginPage(); await login.gotoLoginPage();
await login.loginWithCrtPassword(); await login.loginWithCrtPassword();
await page.waitForTimeout(5000); await page.waitForTimeout(5000);
//Navigate to user page
const user = new UserPage(page); const user = new UserPage(page);
await user.activeUserButtonCheck(); 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); await page.waitForTimeout(5000);
//await expect(await page.locator("//span[@class='flip-indecator']")).toBeVisible();
//Assertion
await expect(await page.locator("//td[normalize-space()='DAYA']")).toBeVisible();
}) })

Loading…
Cancel
Save