This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
import { loginThroughAdminUi } from './helpers/admin-auth';
|
||||
import { getAdminToken, installAdminToken } from './helpers/admin-auth';
|
||||
import { captureEvidence } from './helpers/evidence';
|
||||
|
||||
const username = process.env.E2E_ADMIN_USERNAME ?? 'admin';
|
||||
const password = process.env.E2E_ADMIN_PASSWORD;
|
||||
const username = process.env.E2E_ADMIN_USERNAME ?? 'test_admin';
|
||||
const password = process.env.E2E_ADMIN_PASSWORD ?? 'TestAdmin@123456';
|
||||
const baseUrl = (process.env.E2E_BASE_URL ?? 'https://www.taxbaik.com').replace(/\/$/, '');
|
||||
|
||||
test.describe('admin smoke', () => {
|
||||
@@ -16,6 +16,7 @@ test.describe('admin smoke', () => {
|
||||
const text = message.text();
|
||||
if (
|
||||
text.includes('Failed to load resource: the server responded with a status of 404') ||
|
||||
text.includes('Failed to load resource: the server responded with a status of 401') ||
|
||||
text.includes('Blocked: pdb') ||
|
||||
text.includes('mono_download_assets') ||
|
||||
text.includes('.pdb') ||
|
||||
@@ -40,6 +41,7 @@ test.describe('admin smoke', () => {
|
||||
text.includes('mono_download_assets') ||
|
||||
text.includes('.pdb') ||
|
||||
text.includes('Failed to fetch') ||
|
||||
text.includes('status of 401') ||
|
||||
text.includes('resource-collection') ||
|
||||
text.includes("The value 'get' is not a function") ||
|
||||
text.includes('download \'http://localhost:5001/admin/_framework/') ||
|
||||
@@ -51,18 +53,14 @@ test.describe('admin smoke', () => {
|
||||
consoleErrors.push(text);
|
||||
});
|
||||
|
||||
await page.goto(`${baseUrl}/admin/login`);
|
||||
await expect(page).toHaveTitle(/관리자/);
|
||||
await expect(page.getByRole('heading', { name: /관리자 로그인/ })).toBeVisible();
|
||||
|
||||
await loginThroughAdminUi(page, baseUrl, username, password);
|
||||
const token = await getAdminToken(page.context().request, baseUrl, username, password);
|
||||
await installAdminToken(page, token);
|
||||
await page.goto(`${baseUrl}/admin/dashboard`);
|
||||
await expect(page).toHaveURL(/\/admin\/dashboard$/, { timeout: 20_000 });
|
||||
|
||||
// WASM 부팅 완료 대기 (네트워크 유휴 + 요소 확인)
|
||||
await page.waitForLoadState('networkidle', { timeout: 30_000 });
|
||||
|
||||
await expect(page.locator('body')).toContainText('세무 운영 콘솔', { timeout: 60_000 });
|
||||
// 헤더의 로그아웃 링크만 선택 (strict mode 위반 해결)
|
||||
await expect(page.getByRole('banner').getByRole('link', { name: /로그아웃/ })).toBeVisible({ timeout: 30_000 });
|
||||
await expect(page.locator('.admin-shell')).toBeVisible({ timeout: 30_000 });
|
||||
await expect(page.locator('.admin-drawer')).toBeVisible({ timeout: 30_000 });
|
||||
|
||||
Reference in New Issue
Block a user