[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
    "--tb=short",
    "--strict-markers",
    "-v",
    "--html=reports/test_report.html",
    "--self-contained-html",
    "--cov=utils",
    "--cov-report=html",
    "--cov-report=term-missing"
]
markers = [
    "smoke: 冒烟测试，快速验证核心功能",
    "regression: 回归测试，完整功能验证",
    "performance: 性能测试，页面加载和响应时间",
    "responsive: 响应式测试，不同屏幕尺寸",
    "cross_browser: 跨浏览器测试",
    "form: 表单相关测试",
    "navigation: 导航测试",
    "interactive: 用户交互测试"
]
filterwarnings = [
    "ignore::DeprecationWarning",
    "ignore::PendingDeprecationWarning",
    "ignore::pytest.PytestUnraisableExceptionWarning"
]

[tool.pytest]
# pytest-asyncio配置
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"

[tool.coverage.run]
branch = true
source = ["pages", "utils", "tests"]
omit = ["tests/*", "utils/report_generator.py", "utils/data_generator.py"]

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "def __repr__",
    "raise AssertionError",
    "raise NotImplementedError"
]
