@ -3,6 +3,7 @@ import { LoginPage } from '../pages/LoginPage';
import { ProductPage } from '../pages/ProductPage' ;
test . describe ( 'Product Name Test Cases' , ( ) => {
test ( 'Product button' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
@ -41,8 +42,10 @@ test('Product Name is Empty',async ({page})=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionality ( '' , '250' , '10' , '5' , '20' , 'KK Biriyani' ) ;
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Biriyani']")).toBeVisible();
//Empty Name (Please fill out this field) need to locate.
const locator = page . locator ( "//input[@id='oba_product_name']" ) ;
await expect ( locator ) . toBeFocused ( ) ;
await expect ( locator ) . toBeVisible ( ) ;
await page . close ( ) ;
} )
test ( 'Product Name starts with space' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
@ -50,10 +53,14 @@ test('Product Name starts with space',async ({page})=>{
await login . loginWithCrtPassword ( ) ;
await page . waitForTimeout ( 5000 ) ;
const product = new ProductPage ( page ) ;
await product . addProductFunctionality ( ' Biriyani' , '250' , '10' , '5' , '20' , 'KK Biriyani' ) ;
await product . addProductFunctionality ( ' Biriyani' , '250' , '10' , '5' , '20' , 'KK Biriyani' ) ; //Name with space is accepted i.e space button is not working.
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Biriyani']")).toBeVisible();
//Name with space is accepted i.e space button is not working.
await expect ( page . locator ( "//td[normalize-space()='Biriyani']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'Enter Number instead of name' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
@ -61,10 +68,14 @@ test('Enter Number instead of name',async ({page})=>{
await login . loginWithCrtPassword ( ) ;
await page . waitForTimeout ( 5000 ) ;
const product = new ProductPage ( page ) ;
await product . addProductFunctionality ( '96152456321' , '250' , '10' , '5' , '20' , 'KK Biriyani' ) ;
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Biriyani']")).toBeVisible();
//Name with space is accepted i.e space button is not working.
await product . addProductFunctionality ( '96152456321' , '250' , '10' , '5' , '20' , 'KK Biriyani' ) ; //Name with space is accepted i.e space button is not working.
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//td[normalize-space()='96152456321']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'Enter 50 Alphabet ' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
@ -72,10 +83,14 @@ test('Enter 50 Alphabet ',async ({page})=>{
await login . loginWithCrtPassword ( ) ;
await page . waitForTimeout ( 5000 ) ;
const product = new ProductPage ( page ) ;
await product . addProductFunctionality ( 'asdfghjklzmxncbvqwertyuioplkjhgfdsazxcvbnmqwertyui' , '250' , '10' , '5' , '20' , 'KK Biriyani' ) ;
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Biriyani']")).toBeVisible();
//Name with space is accepted i.e space button is not working.
await product . addProductFunctionality ( 'asdfghjklzmxncbvqwertyuioplkjhgfdsazxcvbnmqwertyui' , '250' , '10' , '5' , '20' , 'KK Biriyani' ) ; //Name with space is accepted i.e space button is not working.
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//td[normalize-space()='asdfghjklzmxncbvqwertyuioplkjhgfdsazxcvbnmqwertyui']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'Enter Special Characters and symbol ' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
@ -85,8 +100,11 @@ test('Enter Special Characters and symbol ',async ({page})=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionality ( '#4nskiu*()' , '250' , '10' , '5' , '20' , 'KK Biriyani' ) ;
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Biriyani']")).toBeVisible();
//Name with space is accepted i.e space button is not working.
await expect ( page . locator ( "//td[normalize-space()='#4nskiu*()']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'Product Name with Alphabet' , async ( { page } ) => {
@ -98,6 +116,10 @@ test('Product Name with Alphabet',async ({page})=>{
await product . addProductFunctionality ( 'Biriyani' , '250' , '10' , '5' , '20' , 'KK Biriyani' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//td[normalize-space()='Biriyani']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'Product Name with space' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
@ -108,6 +130,10 @@ test('Product Name with space',async ({page})=>{
await product . addProductFunctionalityForAll ( 'Butter Naan' , '30' , '10' , '5' , '20' , 'Tasty Butter Naan' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//td[normalize-space()='Butter Naan']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'Product Name with special character' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
@ -118,10 +144,19 @@ test('Product Name with special character',async ({page})=>{
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '50' , '10' , '5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//td[normalize-space()='Idli Chutney & Vadai']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
} )
test . describe ( 'Product Price Test Cases' , ( ) => {
test ( 'Empty product prize' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
@ -130,9 +165,14 @@ test.describe('Product Price Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '' , '10' , '5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
const locator = page . locator ( "//input[@id='oba_product_price']" ) ;
await expect ( locator ) . toBeFocused ( ) ;
await expect ( locator ) . toBeVisible ( ) ;
await page . close ( ) ;
} )
test ( 'Product prize entered other than numeric value' , async ( { page } ) => {
test . skip ( 'Product prize entered other than numeric value' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
@ -151,9 +191,13 @@ test.describe('Product Price Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '-40' , '10' , '5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
const locator = page . locator ( "//input[@id='oba_product_price']" ) ;
await expect ( locator ) . toBeFocused ( ) ;
await expect ( locator ) . toBeVisible ( ) ;
await page . close ( ) ;
} )
test ( 'Product prize entered with Special Characters' , async ( { page } ) => {
test . skip ( 'Product prize entered with Special Characters' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
@ -172,6 +216,10 @@ test('Valid Product prize',async ({page})=>{
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '50' , '10' , '5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//b[normalize-space()='50']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'Product prize in decimal value' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
@ -182,9 +230,13 @@ test('Product prize in decimal value',async ({page})=>{
await product . addProductFunctionalityForAll ( 'Vadai' , '12.27' , '10' , '5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//b[normalize-space()='12.27']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'Valid Product prize' , async ( { page } ) => {
test ( 'Product prize' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
@ -193,7 +245,12 @@ test('Product prize in decimal value',async ({page})=>{
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '50' , '10' , '5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//b[normalize-space()='50']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'Currency Symbol' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
@ -203,6 +260,7 @@ test('Currency Symbol',async ({page})=>{
await product . clickAddProductButton ( ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//span[@class='input-group-text']" ) ) . toBeVisible ( ) ;
await page . close ( ) ;
} )
test ( 'merchant verify price leading with zero' , async ( { page } ) => {
@ -214,6 +272,10 @@ test('merchant verify price leading with zero',async ({page})=>{
await product . addProductFunctionalityForAll ( 'Vadai' , '1209.06' , '10' , '5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//b[normalize-space()='12,09.06']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'merchant verify maximum length allowed' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
@ -224,6 +286,10 @@ test('merchant verify maximum length allowed',async ({page})=>{
await product . addProductFunctionalityForAll ( 'Vadai' , '12095262' , '10' , '5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//b[normalize-space()='12095262']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'merchant enters prize zero allowed' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
@ -234,11 +300,17 @@ test('merchant enters prize zero allowed',async ({page})=>{
await product . addProductFunctionalityForAll ( 'Vadai' , '0' , '10' , '5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//b[normalize-space()='0']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
} )
test . describe ( 'Quantity Limit Test Cases' , ( ) => {
test ( 'Managed Radio button Check' , async ( { page } ) => {
test ( 'Managed Radio button Check' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
@ -246,7 +318,11 @@ test.describe('Quantity Limit Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '10' , '5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
await expect ( page . locator ( "//td[normalize-space()='Idli Chutney & Vadai']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'Empty quantity' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
@ -256,9 +332,12 @@ test.describe('Quantity Limit Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '' , '5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
const locator = page . locator ( "//input[@id='oba_product_quantity']" ) ;
await expect ( locator ) . toBeFocused ( ) ;
await expect ( locator ) . toBeVisible ( ) ;
await page . close ( ) ;
} )
test ( 'Enter other than number' , async ( { page } ) => {
test . skip ( 'Enter other than number' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
@ -268,6 +347,7 @@ test.describe('Quantity Limit Test Cases',()=>{
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
} )
test ( 'merchant enters negative product quantity' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
@ -276,9 +356,12 @@ test.describe('Quantity Limit Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '-30' , '5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
const locator = page . locator ( "//input[@id='oba_product_quantity']" ) ;
await expect ( locator ) . toBeFocused ( ) ;
await expect ( locator ) . toBeVisible ( ) ;
await page . close ( ) ;
} )
test ( 'merchant enters special characters in product quantity' , async ( { page } ) => {
test . skip ( 'merchant enters special characters in product quantity' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
@ -297,6 +380,11 @@ test.describe('Quantity Limit Test Cases',()=>{
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '5' , '5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//td[normalize-space()='5']" ) ) . toBeVisible ( ) ;
await expect ( page . locator ( "//td[normalize-space()='Idli Chutney & Vadai']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'merchant enters decimal quantity' , async ( { page } ) => {
@ -307,7 +395,11 @@ test.describe('Quantity Limit Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '50.5' , '5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//td[normalize-space()='Idli Chutney & Vadai']" ) ) . toBeVisible ( ) ;
const locator = page . locator ( "//input[@id='oba_product_quantity']" ) ;
await expect ( locator ) . toBeFocused ( ) ;
await expect ( locator ) . toBeVisible ( ) ;
await page . close ( ) ;
} )
test ( 'merchant enters zero' , async ( { page } ) => {
@ -319,10 +411,15 @@ test.describe('Quantity Limit Test Cases',()=>{
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '0' , '5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//td[normalize-space()='0']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
} )
test . describe ( 'Unmanaged Button' , ( ) => {
test ( 'UnManaged Radio Button working' , async ( { page } ) => {
test ( 'UnManaged Radio Button working' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
@ -332,9 +429,16 @@ test('UnManaged Radio Button working',async ({page})=>{
await page . waitForTimeout ( 5000 ) ;
//await expect(page.locator("//td[normalize-space()='Tandoori']")).toBeVisible();
await expect ( await page . locator ( "//td[normalize-space()='Un-managed']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
} )
test . describe ( 'Order Limit Test Cases' , ( ) => {
test ( 'Empty order' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
@ -343,7 +447,10 @@ test.describe('Order Limit Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '10' , '' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
const locator = page . locator ( "//input[@id='oba_product_order_limit']" ) ;
await expect ( locator ) . toBeFocused ( ) ;
await expect ( locator ) . toBeVisible ( ) ;
await page . close ( ) ;
} )
test ( 'Space at the start of order limit' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
@ -353,9 +460,13 @@ test.describe('Order Limit Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '10' , ' 6' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
await expect ( await page . locator ( "//td[normalize-space()='10']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'Enter character other than numeric value' , async ( { page } ) => {
test . skip ( 'Enter character other than numeric value' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
@ -363,6 +474,7 @@ test.describe('Order Limit Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '10' , 'one' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
} )
test ( 'Negative order limit' , async ( { page } ) => {
@ -373,9 +485,13 @@ test.describe('Order Limit Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '10' , '-52' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
const locator = page . locator ( "//input[@id='oba_product_order_limit']" ) ;
await expect ( locator ) . toBeFocused ( ) ;
await expect ( locator ) . toBeVisible ( ) ;
await page . close ( ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
} )
test ( 'Special characters in order limit' , async ( { page } ) => {
test . skip ( 'Special characters in order limit' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
@ -393,6 +509,10 @@ test.describe('Order Limit Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '10' , '100.5' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
const locator = page . locator ( "//input[@id='oba_product_order_limit']" ) ;
await expect ( locator ) . toBeFocused ( ) ;
await expect ( locator ) . toBeVisible ( ) ;
await page . close ( ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
} )
test ( 'Order limit leading with zero' , async ( { page } ) => {
@ -403,6 +523,11 @@ test.describe('Order Limit Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '10' , '050' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( await page . locator ( "//td[normalize-space()='50']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
} )
test ( 'Maximum order limit' , async ( { page } ) => {
@ -413,7 +538,11 @@ test.describe('Order Limit Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '10' , '050' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
await expect ( await page . locator ( "//td[normalize-space()='50']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'Zero order limit' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
@ -423,12 +552,16 @@ test.describe('Order Limit Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '10' , '0' , '20' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
const locator = page . locator ( "//input[@id='oba_product_order_limit']" ) ;
await expect ( locator ) . toBeFocused ( ) ;
await expect ( locator ) . toBeVisible ( ) ;
await page . close ( ) ;
} )
} )
test . describe ( 'Product Description' , ( ) => {
test ( 'Empty order' , async ( { page } ) => {
test . skip ( 'Empty order' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
@ -441,7 +574,9 @@ test.describe('Product Description',()=>{
} )
test . describe ( 'Tax in % Test Cases' , ( ) => {
test ( 'Enter special character' , async ( { page } ) => {
test . skip ( 'Enter special character' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
@ -451,7 +586,7 @@ test.describe('Tax in % Test Cases',()=>{
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
} )
test ( 'Enter Alphabet' , async ( { page } ) => {
test . skip ( 'Enter Alphabet' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
@ -461,7 +596,7 @@ test.describe('Tax in % Test Cases',()=>{
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
} )
test ( 'Enter space at the start of the word' , async ( { page } ) => {
test . skip ( 'Enter space at the start of the word' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
@ -489,6 +624,10 @@ test.describe('Tax in % Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '10' , '10' , '' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
const locator = page . locator ( "//input[@id='oba_product_tax']" ) ;
await expect ( locator ) . toBeFocused ( ) ;
await expect ( locator ) . toBeVisible ( ) ;
await page . close ( ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
} )
test ( 'Enter Tax leading with zero' , async ( { page } ) => {
@ -500,6 +639,10 @@ test.describe('Tax in % Test Cases',()=>{
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '10' , '10' , '055' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//td[normalize-space()='Idli Chutney & Vadai']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'Enter Tax% is maximum 100' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
@ -510,6 +653,11 @@ test.describe('Tax in % Test Cases',()=>{
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '10' , '10' , '100' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//td[normalize-space()='Idli Chutney & Vadai']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'Enter Tax% is maximum 110' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
@ -519,7 +667,12 @@ test.describe('Tax in % Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '10' , '10' , '110' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
await expect ( page . locator ( "//td[normalize-space()='Idli Chutney & Vadai']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
test ( 'Enter Tax% in negative value' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
@ -529,6 +682,10 @@ test.describe('Tax in % Test Cases',()=>{
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '10' , '10' , '-10' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
const locator = page . locator ( "//input[@id='oba_product_tax']" ) ;
await expect ( locator ) . toBeFocused ( ) ;
await expect ( locator ) . toBeVisible ( ) ;
await page . close ( ) ;
// await expect(page.locator("//td[normalize-space()='Idli Chutney & Vadai']")).toBeVisible();
} )
test ( 'Enter Tax% is decimal value' , async ( { page } ) => {
@ -540,11 +697,18 @@ test.describe('Tax in % Test Cases',()=>{
await product . addProductFunctionalityForAll ( 'Idli Chutney & Vadai' , '20' , '10' , '10' , '11.23' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//td[normalize-space()='Idli Chutney & Vadai']" ) ) . toBeVisible ( ) ;
await page . locator ( "(//i[@class='fa fa-lg fa-edit'])[3]" ) . click ( ) ;
await page . locator ( "//i[@class='fa fa-lg fa-trash']" ) . click ( ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
await page . close ( ) ;
} )
} )
test . describe ( 'Product Live CheckBox' , ( ) => {
test ( 'Available and not available checkbox' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
@ -560,8 +724,76 @@ test.describe('Product Live CheckBox',()=>{
} )
} )
/ *
test . describe ( 'Product Delete' , ( ) => {
test ( 'Delete Button is working?' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
await page . waitForTimeout ( 5000 ) ;
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityDelete ( 'Idli Chutney & Vadai' , '20' , '10' , '10' , '8' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await expect ( page . locator ( "//button[normalize-space()='Yes, delete it!']" ) ) . toBeVisible ( ) ;
// await product.editProduct();
// await expect(page.locator("//td[normalize-space()='false']")).toBeVisible();
} )
test ( 'Yes Delete Button is working?' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
await page . waitForTimeout ( 5000 ) ;
const product = new ProductPage ( page ) ;
await product . addProductFunctionalityDelete ( 'Idli Chutney & Vadai' , '20' , '10' , '10' , '8' , 'Idli is Tasty' ) ;
await page . waitForTimeout ( 5000 ) ;
await page . locator ( "//button[normalize-space()='Yes, delete it!']" ) . click ( ) ;
// await product.editProduct();
// await expect(page.locator("//td[normalize-space()='false']")).toBeVisible();
} )
test ( 'Navigate to product list page button' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
await page . waitForTimeout ( 5000 ) ;
const product = new ProductPage ( page ) ;
await product . clickAddProductButton ( ) ;
await page . waitForTimeout ( 5000 ) ;
await page . locator ( "//a[@href='productlist']" ) . click ( ) ;
// await product.editProduct();
await expect ( page . locator ( "//i[@class='fa fa-lg fa-fw fa-search']" ) ) . toBeVisible ( ) ;
} )
test ( 'Edit button in product list page' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
await login . loginWithCrtPassword ( ) ;
await page . waitForTimeout ( 5000 ) ;
const product = new ProductPage ( page ) ;
await product . clickProductlistButton ( ) ;
await page . waitForTimeout ( 5000 ) ;
await page . locator ( "//tbody/tr[1]/td[7]/div[1]/a[1]" ) . click ( ) ;
// await product.editProduct();
await expect ( page . locator ( "//label[@id='oba_product_name_label']" ) ) . toBeVisible ( ) ;
} )
} )
test . describe ( 'Product Live CheckBox' , ( ) => {
test ( 'available checkbox' , async ( { page } ) => {
const login = new LoginPage ( page ) ;
await login . gotoLoginPage ( ) ;
@ -628,4 +860,3 @@ test('Product Page6',async ({page})=>{
console . log ( value ) ;
await expect ( page . locator ( "//td[normalize-space()='Biriyani']" ) ) . toContainText ( 'Biriyani' ) ;
} )
* /