-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathglobal-setup.ts
More file actions
17 lines (15 loc) · 846 Bytes
/
Copy pathglobal-setup.ts
File metadata and controls
17 lines (15 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { chromium, expect } from "@playwright/test";
async function globalSetup(){
const browser = await chromium.launch();
const context = await browser.newContext();
const page = await context.newPage();
//Login
await page.goto('https://opensource-demo.orangehrmlive.com/web/index.php/dashboard/index');
await page.getByPlaceholder('Username').fill('Admin');
await page.getByPlaceholder('Password').fill('admin123');
await page.getByRole('button', { name: 'Login' }).click();
await page.waitForURL("https://opensource-demo.orangehrmlive.com/web/index.php/dashboard/index")
await expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible();
await page.context().storageState({path: "./playwright/.auth/auth.json"})
}
export default globalSetup;