수정: 관리자 e2e 인증 흐름 안정화
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m13s
TaxBaik Browser E2E / browser-e2e (push) Failing after 3m26s

This commit is contained in:
2026-06-27 21:16:19 +09:00
parent 8f0cb690c4
commit e0067c6f55
18 changed files with 140 additions and 160 deletions
+21
View File
@@ -0,0 +1,21 @@
import { expect, type APIRequestContext, type Page } from '@playwright/test';
export async function getAdminToken(
request: APIRequestContext,
baseUrl: string,
username: string,
password: string,
) {
const response = await request.post(`${baseUrl}/api/auth/login`, {
data: { username, password },
});
expect(response.status(), 'login API should accept the configured admin credentials').toBe(200);
const body = await response.json();
expect(body?.token, 'login API should return a token').toBeTruthy();
return body.token as string;
}
export async function installAdminToken(page: Page, token: string) {
await page.addInitScript(value => localStorage.setItem('auth_token', value), token);
}