aade9e39d0
- tests/config: 环境配置 (.yaml) + 配置加载器 - tests/utils: 日志工具 + 测试数据生成器 - tests/web: Playwright conftest + Page Object 基类 + 登录页 + 导航栏组件 + 登录用例(6条) - tests/app: Appium conftest + Page Object 基类 + 司机端首页 + 登录用例(3条) - pytest.ini: markers(p0/p1/p2/smoke/web/app) + 运行配置 - 所有用例按最佳实践采用 Page Object 模式 + data-testid 优先定位 + 失败自动截图
34 lines
687 B
INI
34 lines
687 B
INI
[pytest]
|
||
# pytest 配置文件
|
||
|
||
# 测试发现路径
|
||
testpaths = tests
|
||
|
||
# 仅执行以 test_ 开头的文件
|
||
python_files = test_*.py
|
||
python_classes = Test*
|
||
python_functions = test_*
|
||
|
||
# 默认命令行参数
|
||
addopts =
|
||
-v
|
||
--tb=short
|
||
--strict-markers
|
||
--disable-warnings
|
||
-p no:cacheprovider
|
||
|
||
# 自定义 markers
|
||
markers =
|
||
p0: P0 核心流程(冒烟测试)
|
||
p1: P1 主要功能
|
||
p2: P2 次要/异常流程
|
||
smoke: 冒烟测试
|
||
web: Web UI 测试(Playwright)
|
||
app: App UI 测试(Appium)
|
||
|
||
# 日志格式
|
||
log_cli = true
|
||
log_cli_level = INFO
|
||
log_cli_format = %(asctime)s [%(levelname)s] %(name)s — %(message)s
|
||
log_cli_date_format = %H:%M:%S
|