Fix admin routing and Playwright smoke checks
TaxBaik CI/CD / build-and-deploy (push) Successful in 5m22s
TaxBaik CI/CD / build-and-deploy (push) Successful in 5m22s
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
import { loginThroughAdminUi } from './helpers/admin-auth';
|
||||
|
||||
const username = process.env.E2E_ADMIN_USERNAME ?? 'admin';
|
||||
const password = process.env.E2E_ADMIN_PASSWORD;
|
||||
@@ -8,17 +9,10 @@ test.describe('blog CRUD operations', () => {
|
||||
test('complete blog creation, read, update, delete flow', async ({ page }) => {
|
||||
test.skip(!password, 'E2E_ADMIN_PASSWORD is required.');
|
||||
|
||||
// localStorage 초기화 (이전 테스트의 상태 제거)
|
||||
await page.goto(`${baseUrl}/admin/login`);
|
||||
await page.evaluate(() => localStorage.clear());
|
||||
|
||||
// 1. 로그인
|
||||
await page.locator('input[name="username"]').fill(username);
|
||||
await page.locator('input[name="password"]').fill(password);
|
||||
await page.getByRole('button', { name: '로그인' }).click();
|
||||
|
||||
// 대시보드로 리다이렉트 대기 (더 긴 타임아웃)
|
||||
await page.waitForURL('**/admin/dashboard', { timeout: 30_000 });
|
||||
await loginThroughAdminUi(page, baseUrl, username, password);
|
||||
console.log('✓ Logged in and redirected to dashboard');
|
||||
|
||||
// 2. 블로그 페이지로 이동
|
||||
|
||||
Reference in New Issue
Block a user