test: fix E2E base URL for green-blue deployment and use test account
TaxBaik CI/CD / build-and-deploy (push) Successful in 47s

Green-Blue 배포에서 E2E 테스트가 항상 새 버전을 테스트하도록 개선:

Changes:
- E2E_BASE_URL default: http://localhost/taxbaik (Nginx 라우팅 → active 포트)
- 이전: http://localhost:5001/taxbaik (하드코드, 구 버전 테스트 위험)
- CI/E2E 워크플로우: test_admin 계정으로 변경 (실 admin 분리)
- Playwright config 주석 명확화 (Green-Blue 배포 지원)
- 로컬 테스트: Nginx 거쳐서 또는 명시적 포트 설정

Architecture:
┌─────────────────────────┐
│  E2E Test Runner        │
│  (test_admin account)   │
└────────────┬────────────┘
             │
    E2E_BASE_URL (env var)
             │
    ┌────────┴────────┐
    │                 │
 http://localhost/   http://localhost:5001/
  taxbaik (Nginx)    taxbaik (direct)
    │                 │
 ┌──▼──┐             │
 │Nginx├─────────────┘
 └──┬──┘
    │ (active port: 5001 or 5002)
    │
 ┌──▼──────────────┐
 │Active TaxBaik   │
 │(5001 or 5002)   │
 └─────────────────┘

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-28 11:32:23 +09:00
parent 65241c453c
commit 700cdaed4f
4 changed files with 38 additions and 9 deletions
+11 -1
View File
@@ -4,7 +4,17 @@ import { loginThroughAdminUi } from './helpers/admin-auth';
// 테스트 계정 (실 admin 계정과 분리)
const TEST_USERNAME = 'test_admin';
const TEST_PASSWORD = 'test123456';
const baseUrl = (process.env.E2E_BASE_URL ?? 'http://localhost:5001/taxbaik').replace(/\/$/, '');
/**
* Green-Blue 배포 지원:
* - 로컬: Nginx를 거쳐 http://localhost/taxbaik (포트 무관, 항상 active 버전)
* - 원격: 프로덕션 도메인 (Nginx 라우팅)
*
* E2E_BASE_URL 환경변수 우선 사용, 없으면:
* - 운영(localhost): http://localhost/taxbaik (Nginx 라우팅 → active 포트)
* - 로컬 직접 테스트: http://127.0.0.1:5001/taxbaik (개발 포트)
*/
const baseUrl = (process.env.E2E_BASE_URL ?? 'http://localhost/taxbaik').replace(/\/$/, '');
/**
* API를 통한 테스트 데이터 생성