test: 관리자 e2e 검증 안정화
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m9s
TaxBaik Browser E2E / browser-e2e (push) Failing after 3m17s

This commit is contained in:
2026-06-27 21:24:47 +09:00
parent 38e81a7514
commit 9f7e01652d
5 changed files with 42 additions and 19 deletions
+25
View File
@@ -1,5 +1,12 @@
import { expect, type APIRequestContext, type Page } from '@playwright/test';
export type InquiryListItem = {
id: number;
name: string;
phone: string;
message: string;
};
export async function getAdminToken(
request: APIRequestContext,
baseUrl: string,
@@ -19,3 +26,21 @@ export async function getAdminToken(
export async function installAdminToken(page: Page, token: string) {
await page.addInitScript(value => localStorage.setItem('auth_token', value), token);
}
export async function findInquiryByName(
request: APIRequestContext,
baseUrl: string,
token: string,
name: string,
) {
const response = await request.get(`${baseUrl}/api/inquiry?page=1&pageSize=100`, {
headers: { Authorization: `Bearer ${token}` },
});
expect(response.status(), 'admin inquiry list API should be accessible with the token').toBe(200);
const body = await response.json();
const items = (body?.data ?? []) as InquiryListItem[];
const inquiry = items.find(item => item.name === name);
expect(inquiry, `created inquiry ${name} should appear in the admin inquiry API`).toBeTruthy();
return inquiry!;
}