196570c0de
- Create Login.razor component at /login path with Blazor form - Create EmptyLayout to prevent MainLayout wrapping on login page - Update Program.cs to redirect unauthenticated users to /login (Blazor route) - Integrate with CustomAuthenticationStateProvider for proper auth state management - Handle authentication response and token storage Note: Login flow still has routing issues - investigating dashboard redirect Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
import { chromium } from '@playwright/test';
|
|
|
|
(async () => {
|
|
const browser = await chromium.launch();
|
|
const page = await browser.newPage({ viewport: { width: 1280, height: 720 } });
|
|
|
|
try {
|
|
await page.goto('http://localhost:5265/login');
|
|
console.log('✓ Login page loaded');
|
|
|
|
// Check if Blazor component rendered
|
|
const content1 = await page.content();
|
|
if (content1.includes('관리자 아이디')) {
|
|
console.log('✓ Blazor login form rendered');
|
|
}
|
|
|
|
// Fill credentials
|
|
await page.fill('input', 'admin');
|
|
const inputs = await page.$$('input[type="password"]');
|
|
if (inputs.length > 0) {
|
|
await inputs[0].fill('admin');
|
|
}
|
|
|
|
await page.click('button[type="submit"]');
|
|
console.log('✓ Login submitted');
|
|
|
|
// Wait for navigation
|
|
await page.waitForNavigation({ waitUntil: 'networkidle', timeout: 5000 });
|
|
|
|
console.log('✓ Navigation complete');
|
|
console.log(' URL: ' + page.url());
|
|
|
|
// Take screenshot
|
|
await page.screenshot({ path: './login-success.png', fullPage: true });
|
|
console.log('✓ Screenshot saved');
|
|
|
|
} catch (e) {
|
|
console.error('Error:', e.message);
|
|
}
|
|
|
|
await browser.close();
|
|
})();
|