test: 관리자 화면 e2e를 실제 로그인 흐름으로 전환
This commit is contained in:
@@ -27,6 +27,20 @@ export async function installAdminToken(page: Page, token: string) {
|
||||
await page.addInitScript(value => localStorage.setItem('auth_token', value), token);
|
||||
}
|
||||
|
||||
export async function loginThroughAdminUi(
|
||||
page: Page,
|
||||
baseUrl: string,
|
||||
username: string,
|
||||
password: string,
|
||||
) {
|
||||
await page.goto(`${baseUrl}/admin/login`);
|
||||
await page.locator('input[placeholder="사용자명"]').fill(username);
|
||||
await page.locator('input[placeholder="비밀번호"]').fill(password);
|
||||
await page.getByRole('button', { name: '로그인' }).click();
|
||||
await expect(page).toHaveURL(/\/taxbaik\/admin\/dashboard$/);
|
||||
await expect(page.getByRole('heading', { name: '대시보드' })).toBeVisible({ timeout: 20_000 });
|
||||
}
|
||||
|
||||
export async function findInquiryByName(
|
||||
request: APIRequestContext,
|
||||
baseUrl: string,
|
||||
|
||||
Reference in New Issue
Block a user