OBA Website automated using playwright
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

64 lines
2.4 KiB

const {test, expect} =require('@playwright/test')
import { LoginPage } from '../pages/LoginPage';
test('Login Page1',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.login('rabisundaram@gmail.com','#12345678A')
await expect(page).toHaveURL('https://jaicrm1.orderbookings.com/merchant/index/index')
await expect(page).toHaveTitle('OBA')
await expect(await page.locator("//p[contains(text(),'Micheal Rabi')]")).toBeVisible();
await page.close();
})
test('Login Page2',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.login('rabisundaram@gmail.com','')
const msg=await page.locator("//input[@placeholder='Password']").getAttribute("ariaHasPopup");
console.log(msg);
await page.close();
})
test('Login Page3',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.login('','#12345678A')
await expect(page).toHaveURL('https://jaicrm1.orderbookings.com/merchant/index/index')
await expect(page).toHaveTitle('OBA')
await expect(await page.locator("//p[contains(text(),'Micheal Rabi')]")).toBeVisible();
//document.querySelector('input').value = 'New Value';
// await page.waitForTimeout(3000)
// await expect(await this.page.getByLabel('rabisundaram@gmail.com')).toBeVisible();
await page.close();
})
test('ForgotPassword',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await page.waitForTimeout(3000)
await login.forgetPasswordLink()
await page.waitForTimeout(3000)
await expect(await page.locator("//button[normalize-space()='RESET']")).toBeVisible();
})
test('BacktoLogin',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await page.waitForTimeout(3000)
await login.forgetPasswordLink()
await page.waitForTimeout(3000)
await login.backToLoginLink()
await page.waitForTimeout(3000)
await expect(await page.locator("//button[normalize-space()='SIGN IN']")).toBeVisible();
})
test('Login Page 4',async ({page})=>{
const login = new LoginPage(page);
await login.gotoLoginPage();
await login.login('midhaja','#12345678A')
await page.waitForTimeout(3000)
const errorMessage = await page.locator("//div[@role='alert']").textContent()
console.log(errorMessage);
await expect(await page.locator("//div[@role='alert']")).toBeVisible();
})