Files
xst 18890c0437 refactor(tests): restructure into layered POM architecture with Allure reporting
- Split framework into core/ (config, logger, db, driver factories, screenshot,
  allure integration) and pages/ (PO layer: base/admin/driver); flatten test
  files per platform (web/admin, app/driver_android, cross_end)
- Slim root conftest.py 656 -> ~100 lines: drop inline CN HTML report, add
  Allure severity mapping (p0/p1/p2 -> blocker/normal/minor) and
  environment.properties; support both tests.*-prefixed and bare imports
- Preserve TC-D2S-001/002 cross-end E2E cases with business logic unchanged,
  add allure epic/feature/story/step annotations
- Deduplicate: single makereport hook, shared failure-screenshot helpers,
  single SCREENSHOTS_DIR constant; deterministic auth-state role loading
- Move DB credentials from db_helper.py into test_config.yaml (database section)
- Move pytest.ini to repo root; switch reporting to allure-pytest
  (drop pytest-html/junitxml); update requirements.txt accordingly
- Delete deprecated scaffolding: test_freight_full_flow + 6 stale page
  objects, iOS/shipper empty shells, dead utils
- Fix flaky vxe-table action-row wait: wait for a visible td instead of
  hidden placeholder rows (fixed shipper-payment timeouts)
- Verified end-to-end against live env: both E2E cases pass (2 passed 3m12s);
  run artifacts (logs/screenshots/allure) included per repo convention
2026-08-17 14:29:52 +08:00
..

司机端小程序 — miniprogram-automator

环境搭建

1. 安装微信开发者工具

  • 下载地址
  • 安装后打开设置 → 安全 → 安全,开启服务端口

2. 安装 Node.js 依赖

cd tests/web/mini_program/automator
npm install

3. 编译 uni-app 为微信小程序

# 回到项目根目录(即 uni-app 源码所在目录)
npm run build:mp-weixin

4. 配置 test_config.yaml

mini_program:
  project_path: "E:/path/to/your/uniapp/dist/dev/mp-weixin"  # uni-app 编译产物目录
  dev_tool_path: "C:/Program Files (x86)/Tencent/微信web开发者工具/cli.bat"

运行

pytest tests/web/mini_program/ -v -m p0

原理

pytest 用例
  ↓ conftest.py: subprocess
  ↓
node runner.js --action smoke --project-path ...
  ↓ miniprogram-automator API
  ↓
微信开发者工具(开启服务端口)
  ↓
小程序运行
  ↓
返回 JSON { ok, message, screenshot }
  ↓
Python 断言

可用 actions

action 参数 说明
smoke — 启动小程序并检查首页
navigate page=/pages/xxx/xxx 导航到指定页面
element element-action=tap/exists selector=.class 操作/检查元素

注意事项

  • 登录:首次在开发者工具中手动登录,后续 miniprogram-automator 启动默认复用登录态
  • 截图:输出到 output/screenshots/mini_program/
  • CI:微信开发者工具必须安装在 CI 机器上,且需要 GUI 环境(不能纯 headless)