feat(e2e-tests): 添加端到端测试框架及测试用例

refactor(components): 调整头部和页脚布局样式
style(hero-section): 更新徽章动画效果

docs: 添加测试框架README文档
test: 实现首页、导航和联系表单的测试用例
ci: 添加CI测试脚本和配置
This commit is contained in:
张翔
2026-02-02 19:36:33 +08:00
parent 150024b6ac
commit f14002559e
30 changed files with 6377 additions and 17 deletions
+48
View File
@@ -0,0 +1,48 @@
[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"
]