Refine admin login flow and verification harness
TaxBaik CI/CD / build-and-deploy (push) Successful in 2m21s
TaxBaik CI/CD / build-and-deploy (push) Successful in 2m21s
This commit is contained in:
@@ -23,6 +23,13 @@ def wait_for_server(url, timeout=30):
|
||||
time.sleep(1)
|
||||
return False
|
||||
|
||||
def is_server_healthy(url):
|
||||
try:
|
||||
with urllib.request.urlopen(url, timeout=3) as response:
|
||||
return response.status == 200
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def main():
|
||||
port = 5001
|
||||
base_url = f"http://localhost:{port}/taxbaik"
|
||||
@@ -51,9 +58,12 @@ def main():
|
||||
else:
|
||||
print("Database port 5432 is already active.")
|
||||
|
||||
if is_port_in_use(port):
|
||||
print(f"Warning: Port {port} is already in use. Assuming local server is already running.")
|
||||
server_healthy = is_server_healthy(health_url)
|
||||
if is_port_in_use(port) and server_healthy:
|
||||
print(f"Warning: Port {port} is already in use and the local server is healthy.")
|
||||
else:
|
||||
if is_port_in_use(port):
|
||||
print(f"Warning: Port {port} is already in use but the local server is not healthy. Starting a new server attempt may fail if another process is bound.")
|
||||
print(f"Starting dotnet local server on port {port}...")
|
||||
# Start dotnet run in background
|
||||
env = os.environ.copy()
|
||||
@@ -105,10 +115,14 @@ def main():
|
||||
test_env["E2E_BASE_URL"] = base_url
|
||||
# Set default test credentials
|
||||
test_env["E2E_ADMIN_USERNAME"] = "test_admin"
|
||||
test_env["E2E_ADMIN_PASSWORD"] = "TestAdmin@123456"
|
||||
test_env["E2E_ADMIN_PASSWORD"] = "admin123"
|
||||
|
||||
# Run playwright test command
|
||||
# Local 1차 검증은 Desktop Chrome만 대상으로 잡아 불필요한 브라우저 설치 의존을 줄인다.
|
||||
cmd = ["npx", "playwright", "test"]
|
||||
has_project_arg = any(arg.startswith("--project=") or arg == "--project" for arg in sys.argv[1:])
|
||||
if not has_project_arg:
|
||||
cmd.append('--project="Desktop Chrome"')
|
||||
if len(sys.argv) > 1:
|
||||
cmd.extend(sys.argv[1:])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user