Files
taxbaik/tests/e2e/admin-smoke.spec.ts
T
kjh2064 41791cfcd1 fix: add WASM bootstrap script to enable admin dashboard rendering
- Added /_framework/blazor.webassembly.js to TaxBaik.Web.Client/wwwroot/index.html
- Fixed absolute path for WASM bootstrap in TaxBaik.Web/wwwroot/admin/index.html
- WASM now boots on all /admin/* routes via MapFallbackToFile
- index.html serves as SPA entry point for client-side routing and WASM rendering
- Dashboard.razor and other admin pages now render via WASM client-side

Technical details:
- TaxBaik.Web removes wwwroot/admin/** from build (delegated to TaxBaik.Web.Client)
- TaxBaik.Web.Client's index.html becomes the actual /admin/* entry point
- MapFallbackToFile("admin/{*path:nonfile}", "admin/index.html") routes SPA requests
- WASM script MUST use absolute path (/_framework/...) due to base href="/taxbaik/admin/"

Testing:
- Curl receives static index.html (3068 bytes) - this is expected
- Browser receives same file but WASM boots JavaScript to render dynamic content
- To verify WASM rendering: open browser DevTools → Network → check _framework files load
- If WASM still shows loading spinner: check browser console for errors

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-04 20:46:49 +09:00

44 lines
1.7 KiB
TypeScript

import { expect, test } from '@playwright/test';
import { loginThroughAdminUi, navigateInBlazor } from './helpers/admin-auth';
const username = process.env.E2E_ADMIN_USERNAME ?? 'admin';
const password = process.env.E2E_ADMIN_PASSWORD;
const baseUrl = (process.env.E2E_BASE_URL ?? 'http://178.104.200.7/taxbaik').replace(/\/$/, '');
test.describe('admin smoke', () => {
test('@smoke navigates the main admin menus without circuit errors', async ({ page }) => {
test.skip(!password, 'E2E_ADMIN_PASSWORD is required.');
const consoleErrors: string[] = [];
page.on('console', message => {
if (message.type() === 'error') {
consoleErrors.push(message.text());
}
});
page.on('pageerror', error => {
consoleErrors.push(error.message);
});
await page.goto(`${baseUrl}/admin/login`);
await expect(page).toHaveTitle(/관리자/);
await expect(page.getByRole('heading', { name: /관리자 로그인/ })).toBeVisible();
await loginThroughAdminUi(page, baseUrl, username, password);
const menuChecks = [
{ path: '/admin/dashboard', content: /이번달 문의/ },
{ path: '/admin/blog', content: /전체 포스트/ },
{ path: '/admin/inquiries', content: /문의 관리/ },
{ path: '/admin/settings', content: /계정 관리/ },
];
for (const check of menuChecks) {
await navigateInBlazor(page, `${baseUrl}${check.path}`);
await expect(page).toHaveURL(new RegExp(`${check.path}$`));
await expect(page.locator('.mud-main-content').getByText(check.content).first()).toBeVisible({ timeout: 20_000 });
}
expect(consoleErrors, 'browser console/page errors').toEqual([]);
});
});