03e152baab
目录结构: tests/web/admin/ 管理端 (Playwright) tests/web/mini_program/ 司机端小程序 (Playwright/微信 WebView) tests/app/driver_android/ 司机安卓 (Appium) tests/app/shipper_android/ 货主安卓 (Appium) tests/app/driver_ios/ 司机苹果 (Appium) tests/app/shipper_ios/ 货主苹果 (Appium) 公共模块: tests/app/_shared.py driver+ensure_logged_in 工厂 tests/app/_base_page.py App Page Object 基类 配置: test_config.yaml 拆分为 6 个独立 section + 货主账号
147 lines
6.9 KiB
YAML
147 lines
6.9 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"
|
|
|
|
# ═══════════════════════════════════════════════════════════════════
|
|
# ── 司机端小程序 (Web/Playwright,模拟微信 WebView) ──
|
|
# ═══════════════════════════════════════════════════════════════════
|
|
mini_program:
|
|
base_url: "https://ybxcx.ynyun8.com:8000/mini" # ⚠️ 请确认小程序 WebView 实际地址
|
|
timeout_seconds: 120
|
|
screenshot_on_failure: true
|
|
screenshot_on_step: false
|
|
browsers:
|
|
- chromium
|
|
# 模拟微信内置浏览器 UA
|
|
user_agent: "Mozilla/5.0 MicroMessenger/8.0.0"
|
|
viewport:
|
|
width: 375
|
|
height: 812
|
|
|
|
# 小程序本质是 WebView,同样支持 storage_state 复用
|
|
skip_login: true
|
|
storage_state_dir: "tests/web/auth"
|
|
|
|
# ═══════════════════════════════════════════════════════════════════
|
|
# ── 司机安卓端 (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.yunba.shipper" # ⚠️ 请确认实际包名
|
|
app_activity: ".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"
|