17 lines
526 B
TypeScript
17 lines
526 B
TypeScript
import { Page } from '@playwright/test';
|
|
|
|
export const DEMO = {
|
|
tenant: 'demo-isp',
|
|
email: 'admin@demo-isp.com',
|
|
password: 'Admin123!',
|
|
};
|
|
|
|
export async function login(page: Page, creds = DEMO) {
|
|
await page.goto('/login');
|
|
await page.fill('input[placeholder="e.g. demo-isp"]', creds.tenant);
|
|
await page.fill('input[type="email"]', creds.email);
|
|
await page.fill('input[type="password"]', creds.password);
|
|
await page.click('button[type="submit"]');
|
|
await page.waitForURL('**/dashboard', { timeout: 10000 });
|
|
}
|