Files
taxbaik/tests/e2e/full-admin-pages.spec.ts
T
kjh2064 3b055bbc93 경로 최적화 완료: 상대경로 + Nginx rewrite 준비
## 완료 항목
-  index.html base href: /taxbaik/admin/
-  모든 API 경로: 상대경로
-  E2E 테스트: 로컬 완벽 통과
-  WASM 부팅: 정상

## 운영서버 필수 사항
⚠️ Nginx 설정 변경 필수:

변경 전:
location /taxbaik {
    proxy_pass         http://127.0.0.1:5001;
}

변경 후:
location /taxbaik/ {
    proxy_pass         http://127.0.0.1:5001/;
    rewrite ^/taxbaik/(.*)$ /$1 break;
}

## 이유
- PathBase 제거로 앱이 /taxbaik을 인식하지 않음
- Nginx에서 /taxbaik 프리픽스를 제거해야 함
- 이렇게 하면 로컬/운영 모두 동일한 상대경로 동작

## 테스트 결과
로컬:
 공개 페이지: 5/5 통과
 대시보드: 4/4 통과 (퀵테스트)

운영:
 Nginx 수정 후 재테스트 필요

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-08 16:27:48 +09:00

96 lines
3.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { test, expect } from '@playwright/test';
import { loginThroughAdminUi, navigateInBlazor } from './helpers/admin-auth';
import { captureEvidence } from './helpers/evidence';
test('production: verify all admin pages load correctly', async ({ page }) => {
const baseUrl = (process.env.E2E_BASE_URL || 'https://www.taxbaik.com').replace(/\/$/, '');
// Login
console.log('🔐 Logging in...');
await loginThroughAdminUi(page, baseUrl, 'admin', 'Admin123!@#456');
console.log('✓ Login successful\n');
const pageHero = page.locator('.admin-page-hero').first();
const loadingOverlay = page.locator('#blazor-loading');
// List of all admin pages to test (using direct URLs)
const pages = [
{ name: '📊 Dashboard', url: `${baseUrl}/admin/dashboard`, hasData: false },
{ name: '👥 Clients', url: `${baseUrl}/admin/clients`, hasData: true },
{ name: '📅 Tax Filings', url: `${baseUrl}/admin/tax-filings`, hasData: true },
{ name: '📢 Announcements', url: `${baseUrl}/admin/announcements`, hasData: false },
{ name: '❓ FAQs', url: `${baseUrl}/admin/faqs`, hasData: true },
{ name: '📝 Blog', url: `${baseUrl}/admin/blog`, hasData: true },
{ name: '🎭 Season Simulator', url: `${baseUrl}/admin/season-simulator`, hasData: false },
{ name: '❔ Inquiries', url: `${baseUrl}/admin/inquiries`, hasData: true },
{ name: '⚙️ Settings', url: `${baseUrl}/admin/settings`, hasData: false },
];
for (const pageInfo of pages) {
console.log(`${'─'.repeat(60)}`);
console.log(`Testing: ${pageInfo.name}`);
console.log(`URL: ${pageInfo.url}`);
console.log(`${'─'.repeat(60)}`);
const startTime = Date.now();
try {
// Navigate to page
await navigateInBlazor(page, pageInfo.url);
// Wait for page hero or basic element
try {
await pageHero.waitFor({ state: 'visible', timeout: 3000 });
console.log(` ✓ Page hero visible`);
} catch {
// Some pages might not have page hero, that's OK
}
// Check if page loaded successfully by looking for content
const pageContent = page.locator('body').first();
await pageContent.waitFor({ state: 'visible', timeout: 5000 });
// Wait for data if expected
if (pageInfo.hasData) {
try {
// Try to find table rows
await page.waitForSelector('tbody tr', { timeout: 8000 });
const rowCount = await page.locator('tbody tr').count();
if (rowCount > 0) {
console.log(` ✓ Data loaded: ${rowCount} rows`);
} else {
console.log(` ⚠️ Table found but no rows`);
}
} catch {
console.log(` ️ No table data (may not have table)`);
}
}
// Verify overlay is hidden
const overlayShown = await loadingOverlay.evaluate((el: HTMLElement) =>
el.classList.contains('show')
).catch(() => false);
if (!overlayShown) {
console.log(` ✓ Loading overlay hidden`);
} else {
console.log(` ⚠️ Loading overlay still visible`);
}
const totalTime = Date.now() - startTime;
console.log(` ⏱️ Load time: ${totalTime}ms`);
console.log(` ✅ PAGE LOADED SUCCESSFULLY\n`);
await captureEvidence(page, test.info(), pageInfo.name.replace(/[^a-zA-Z0-9]+/g, '_').toLowerCase());
} catch (error) {
const totalTime = Date.now() - startTime;
console.log(` ❌ FAILED: ${error}`);
console.log(` ⏱️ Time: ${totalTime}ms\n`);
throw error;
}
}
console.log(`${'═'.repeat(60)}`);
console.log('✅ ALL PAGES VERIFIED SUCCESSFULLY');
console.log(`${'═'.repeat(60)}`);
});