|
const {test, expect} =require('@playwright/test')
|
|
import { LoginPage } from '../pages/LoginPage';
|
|
import { ProductPage } from '../pages/ProductPage';
|
|
/*
|
|
test('Product Page1',async ({page})=>{
|
|
const login = new LoginPage(page);
|
|
await login.gotoLoginPage();
|
|
await login.loginWithCrtPassword();
|
|
await page.waitForTimeout(5000);
|
|
const product = new ProductPage(page);
|
|
await product.clickProductsButton();
|
|
await page.waitForTimeout(5000);
|
|
await expect(await page.locator("//a[normalize-space()='Product List']")).toBeVisible();
|
|
})
|
|
test('Product Page2',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 expect(await page.locator("//input[@id='oba_product_search']")).toBeVisible();
|
|
})
|
|
test('Product Page3',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 expect(await page.locator("//input[@id='oba_product_name']")).toBeVisible();
|
|
})
|
|
test('Product Page4',async ({page})=>{
|
|
const login = new LoginPage(page);
|
|
await login.gotoLoginPage();
|
|
await login.loginWithCrtPassword();
|
|
await page.waitForTimeout(5000);
|
|
const product = new ProductPage(page);
|
|
await product.addProductFunctionality('Biriyani', '250', '10', '5', '20','Dum Dum KK Biriyani');
|
|
await page.waitForTimeout(5000);
|
|
await expect(await page.locator("//td[normalize-space()='Biriyani']")).toBeVisible();
|
|
|
|
})
|
|
test('Product Page5',async ({page})=>{
|
|
const login = new LoginPage(page);
|
|
await login.gotoLoginPage();
|
|
await login.loginWithCrtPassword();
|
|
await page.waitForTimeout(5000);
|
|
const product = new ProductPage(page);
|
|
await product.addProductFunctionalityUnmanaged('Biriyani', '250', '5', '20','Dum Dum KK Biriyani');
|
|
|
|
await page.waitForTimeout(5000);
|
|
await expect(await page.locator("//td[normalize-space()='Biriyani']")).toBeVisible();
|
|
})
|
|
test('Product Page6',async ({page})=>{
|
|
const login = new LoginPage(page);
|
|
await login.gotoLoginPage();
|
|
await login.loginWithCrtPassword();
|
|
await page.waitForTimeout(5000);
|
|
const product = new ProductPage(page);
|
|
await product.addProductFunctionalityUnmanaged('Biriyani', '250', '5', '20','Dum Dum KK Biriyani');
|
|
|
|
await page.waitForTimeout(5000);
|
|
await expect(await page.locator("//td[normalize-space()='Un-managed']")).toBeVisible();
|
|
})*/
|
|
test('Product Page7',async ({page})=>{
|
|
const login = new LoginPage(page);
|
|
await login.gotoLoginPage();
|
|
await login.loginWithCrtPassword();
|
|
await page.waitForTimeout(5000);
|
|
const product = new ProductPage(page);
|
|
await product.addProductFunctionality('Biriyani', '250', '10', '5', '20','Dum Dum KK Biriyani');
|
|
|
|
await page.waitForTimeout(5000);
|
|
const options = await page.locator('//tbody/tr[1]/td[4]')
|
|
await expect(options).toHaveCount(10);
|
|
//await expect(await page.locator("//tbody/tr[1]/td[4]")).toBeVisible();
|
|
})
|
|
|
|
|
|
|
|
|
|
|