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();
|
|
|
|
try {
|
|
await page.goto('http://localhost:5265/login');
|
|
console.log('✓ Loaded login page');
|
|
|
|
// Fill and submit
|
|
await page.fill('input[type="text"]', 'admin');
|
|
await page.fill('input[type="password"]', 'admin');
|
|
await page.click('button[type="submit"]');
|
|
console.log('✓ Form submitted');
|
|
|
|
// Wait for page load
|
|
await page.waitForNavigation({ waitUntil: 'load', timeout: 10000 });
|
|
|
|
const url = page.url();
|
|
const content = await page.content();
|
|
|
|
console.log('\nResult:');
|
|
console.log(' URL: ' + url);
|
|
|
|
if (url.includes('/dashboard') && content.includes('관리자 대시보드')) {
|
|
console.log('✓ Dashboard successfully loaded!');
|
|
} else if (content.includes('Not Found')) {
|
|
console.log('✗ Error: Not Found');
|
|
} else {
|
|
console.log(' Status: Other');
|
|
}
|
|
|
|
await page.screenshot({ path: './login-result.png', fullPage: true });
|
|
console.log(' Screenshot: login-result.png');
|
|
|
|
} catch (e) {
|
|
console.error('Test failed:', e.message);
|
|
}
|
|
|
|
await browser.close();
|
|
})();
|