b580633eac
- Update login.html to wait 4 seconds before dashboard redirect - Give Blazor time to initialize and read auth token from localStorage - Simplify redirect flow (remove auth-redirect.html) - Fix token storage in localStorage for auth state Issue: Dashboard access still redirecting to /not-found Root cause: Token from static HTML not being picked up by Blazor auth Next steps: Implement server-side cookie-based auth or refactor to Blazor login Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
44 lines
1.2 KiB
JavaScript
44 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');
|
|
await page.fill('input[name="username"]', 'admin');
|
|
await page.fill('input[name="password"]', 'admin');
|
|
await page.click('button[type="submit"]');
|
|
|
|
console.log('Waiting for dashboard via auth-redirect...');
|
|
|
|
try {
|
|
await page.waitForNavigation({ waitUntil: 'load', timeout: 10000 });
|
|
} catch (e) {
|
|
// Expected - might timeout if already on dashboard
|
|
}
|
|
|
|
const url = page.url();
|
|
const content = await page.content();
|
|
|
|
console.log('Final URL: ' + url);
|
|
|
|
if (url.includes('/dashboard')) {
|
|
if (content.includes('관리자 대시보드')) {
|
|
console.log('✓✓✓ SUCCESS: Login complete and dashboard loaded!');
|
|
} else if (content.includes('Not Found')) {
|
|
console.log('✗ Not Found error');
|
|
}
|
|
} else {
|
|
console.log('URL is: ' + url);
|
|
}
|
|
|
|
await page.screenshot({ path: './test-result.png' });
|
|
|
|
} catch (e) {
|
|
console.error('Error:', e.message);
|
|
}
|
|
|
|
await browser.close();
|
|
})();
|