feat: create Blazor-based login component with EmptyLayout
- 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>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import { chromium } from '@playwright/test';
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const browser = await chromium.launch();
|
||||
const page = await browser.newPage({ viewport: { width: 1280, height: 720 } });
|
||||
|
||||
// Go to login page
|
||||
await page.goto('http://localhost:5265/login');
|
||||
console.log('Loaded login page');
|
||||
|
||||
// Fill in credentials
|
||||
await page.fill('input[name="username"]', 'admin');
|
||||
await page.fill('input[name="password"]', 'admin');
|
||||
|
||||
// Submit
|
||||
await page.click('button[type="submit"]');
|
||||
console.log('Submitted login form');
|
||||
|
||||
// Wait for navigation
|
||||
await page.waitForNavigation({ waitUntil: 'networkidle' });
|
||||
console.log('Page navigated');
|
||||
|
||||
// Check URL
|
||||
console.log('Current URL: ' + page.url());
|
||||
|
||||
// Check content
|
||||
const content = await page.content();
|
||||
if (content.includes('Not Found')) {
|
||||
console.log('ERROR: Page shows Not Found');
|
||||
} else if (content.includes('관리자 대시보드') || content.includes('Dashboard')) {
|
||||
console.log('SUCCESS: Dashboard loaded');
|
||||
} else {
|
||||
console.log('Other content loaded');
|
||||
}
|
||||
|
||||
// Take screenshot
|
||||
await page.screenshot({ path: './test-dashboard.png', fullPage: true });
|
||||
|
||||
await browser.close();
|
||||
} catch (e) {
|
||||
console.error('Test failed:', e.message);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user