b822428a2a
驱动方式: Python pytest → subprocess → node runner.js → miniprogram-automator → 微信开发者工具 架构: tests/web/mini_program/automator/ (Node.js) + conftest.py (Python subprocess 桥接) 前置条件: 微信开发者工具 + 开启服务端口 + npm install + uni-app build:mp-weixin
145 lines
7.3 KiB
YAML
145 lines
7.3 KiB
YAML
# 运八网络货运平台 — 测试环境配置
|
||
# 数据来源: knowledge_base/00_project/project_profile.md
|
||
# 使用方式: from tests.config.test_config import load_config
|
||
#
|
||
# 覆盖端:
|
||
# Web: 管理端 admin / 司机端小程序 mini_program
|
||
# App: 司机安卓 driver_android / 货主安卓 shipper_android
|
||
# 司机苹果 driver_ios / 货主苹果 shipper_ios
|
||
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
# ── 管理端 (Web/Playwright) ──
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
admin:
|
||
base_url: "https://ybxcx.ynyun8.com:8000/admin"
|
||
api_base_url: "https://ybxcx.ynyun8.com:8000/"
|
||
timeout_seconds: 120
|
||
screenshot_on_failure: true
|
||
screenshot_on_step: false
|
||
browsers:
|
||
- chromium
|
||
- firefox
|
||
viewport:
|
||
width: 1920
|
||
height: 1080
|
||
|
||
# 登录态复用: python tests/web/admin/save_auth.py 生成后自动跳过验证码
|
||
skip_login: true
|
||
storage_state_dir: "tests/web/auth"
|
||
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
# ── 司机端小程序 (miniprogram-automator / Node.js) ──
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
# 原理: Python pytest → subprocess → node runner.js → miniprogram-automator
|
||
# 操控微信开发者工具中的小程序,返回 JSON 结果
|
||
#
|
||
# 前置条件:
|
||
# 1. 安装微信开发者工具 + 开启服务端口(设置 → 安全 → 服务端口)
|
||
# 2. uni-app 编译为微信小程序: npm run build:mp-weixin
|
||
# 3. 安装依赖: cd tests/web/mini_program/automator && npm install
|
||
mini_program:
|
||
# uni-app 编译出的小程序项目路径(.js/.json/.wxml 所在目录)
|
||
project_path: "E:/test/QaAutomationHub/mini_program/dist" # ⚠️ 请确认实际路径
|
||
# 微信开发者工具 CLI 路径(Windows 默认如下,macOS 为 /Applications/...)
|
||
dev_tool_path: "C:/Program Files (x86)/Tencent/微信web开发者工具/cli.bat"
|
||
timeout_seconds: 120
|
||
screenshot_on_failure: true
|
||
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
# ── 司机安卓端 (App/Appium) ──
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
driver_android:
|
||
appium_host: "http://localhost:4723"
|
||
timeout_seconds: 120
|
||
screenshot_on_failure: true
|
||
platform: android
|
||
skip_login: true # 手动登录一次后 noReset 自动复用
|
||
|
||
device_name: "Android Emulator"
|
||
app_package: "com.arpa.ynchenggangdriver" # ⚠️ 请确认实际包名
|
||
app_activity: "com.arpa.ntocc.MainActivity" # ⚠️ 请确认实际启动 Activity
|
||
no_reset: true
|
||
new_command_timeout: 120
|
||
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
# ── 货主安卓端 (App/Appium) ──
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
shipper_android:
|
||
appium_host: "http://localhost:4723"
|
||
timeout_seconds: 120
|
||
screenshot_on_failure: true
|
||
platform: android
|
||
skip_login: true
|
||
|
||
device_name: "Android Emulator"
|
||
app_package: "com.arpa.ynChengGangShipper" # ⚠️ 请确认实际包名
|
||
app_activity: "com.arpa.wuche_shipper.MainActivity" # ⚠️ 请确认实际启动 Activity
|
||
no_reset: true
|
||
new_command_timeout: 120
|
||
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
# ── 司机苹果端 (App/Appium,需 macOS) ──
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
driver_ios:
|
||
appium_host: "http://localhost:4723"
|
||
timeout_seconds: 120
|
||
screenshot_on_failure: true
|
||
platform: ios
|
||
skip_login: true
|
||
|
||
device_name: "iPhone 15"
|
||
bundle_id: "com.arpa.ynchenggangdriver" # ⚠️ 请确认实际 Bundle ID
|
||
no_reset: true
|
||
new_command_timeout: 120
|
||
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
# ── 货主苹果端 (App/Appium,需 macOS) ──
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
shipper_ios:
|
||
appium_host: "http://localhost:4723"
|
||
timeout_seconds: 120
|
||
screenshot_on_failure: true
|
||
platform: ios
|
||
skip_login: true
|
||
|
||
device_name: "iPhone 15"
|
||
bundle_id: "com.yunba.shipper" # ⚠️ 请确认实际 Bundle ID
|
||
no_reset: true
|
||
new_command_timeout: 120
|
||
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
# ── 测试账号 ──
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
accounts:
|
||
super_admin:
|
||
phone: "super_admin"
|
||
password: "951260684NiAn.."
|
||
role: "平台运营人员"
|
||
use_on: [admin]
|
||
|
||
team_leader:
|
||
phone: "13113113113"
|
||
password: "88888888"
|
||
role: "车队长"
|
||
use_on: [admin, mini_program]
|
||
|
||
driver:
|
||
phone: "15188888888"
|
||
password: "88888888"
|
||
role: "司机"
|
||
use_on: [mini_program, driver_android, driver_ios]
|
||
|
||
shipper:
|
||
phone: "13800000000" # ⚠️ 请确认实际货主账号
|
||
password: "88888888"
|
||
role: "货主"
|
||
use_on: [shipper_android, shipper_ios]
|
||
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
# ── 报告 ──
|
||
# ═══════════════════════════════════════════════════════════════════
|
||
report:
|
||
logs_dir: "output/logs"
|
||
screenshots_dir: "output/screenshots"
|
||
junit_xml: "output/reports/junit.xml"
|