feat: 重构测试框架并优化代码结构
refactor(tests): 将e2e_tests迁移到tests_suite和api_integration_tests style: 为Java类添加文档注释 docs: 更新.gitignore和配置文件 test: 添加性能测试和Playwright测试脚本 chore: 清理旧测试文件和配置
This commit is contained in:
@@ -0,0 +1 @@
|
||||
"""配置模块"""
|
||||
@@ -0,0 +1,74 @@
|
||||
"""
|
||||
配置管理模块
|
||||
"""
|
||||
|
||||
import os
|
||||
from typing import Optional
|
||||
from pydantic_settings import BaseSettings
|
||||
from pydantic import Field
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""应用配置"""
|
||||
|
||||
API_BASE_URL: str = Field(
|
||||
default="http://localhost:8080",
|
||||
description="API基础URL"
|
||||
)
|
||||
|
||||
DATABASE_HOST: str = Field(
|
||||
default="localhost",
|
||||
description="数据库主机"
|
||||
)
|
||||
|
||||
DATABASE_PORT: int = Field(
|
||||
default=55432,
|
||||
description="数据库端口"
|
||||
)
|
||||
|
||||
DATABASE_NAME: str = Field(
|
||||
default="manage_system",
|
||||
description="数据库名称"
|
||||
)
|
||||
|
||||
DATABASE_USERNAME: str = Field(
|
||||
default="postgres",
|
||||
description="数据库用户名"
|
||||
)
|
||||
|
||||
DATABASE_PASSWORD: str = Field(
|
||||
default="postgres",
|
||||
description="数据库密码"
|
||||
)
|
||||
|
||||
TEST_USERNAME: str = Field(
|
||||
default="admin",
|
||||
description="测试用户名"
|
||||
)
|
||||
|
||||
TEST_PASSWORD: str = Field(
|
||||
default="admin123",
|
||||
description="测试用户密码"
|
||||
)
|
||||
|
||||
REQUEST_TIMEOUT: int = Field(
|
||||
default=30000,
|
||||
description="请求超时时间(毫秒)"
|
||||
)
|
||||
|
||||
HEADLESS_BROWSER: bool = Field(
|
||||
default=True,
|
||||
description="无头浏览器模式"
|
||||
)
|
||||
|
||||
BROWSER_TYPE: str = Field(
|
||||
default="chromium",
|
||||
description="浏览器类型"
|
||||
)
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
env_file_encoding = "utf-8"
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user