Files
QaAutomationHub/tests/app/shipper_ios/conftest.py
T
xst 03e152baab feat: 重构测试框架 — 覆盖 6 端 (管理端 + 小程序 + 4 个移动端)
目录结构:
  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 + 货主账号
2026-07-15 14:02:08 +08:00

28 lines
793 B
Python

"""货主苹果端 fixture — Appium + 登录态复用。"""
import pytest
from tests.app._shared import create_driver, make_ensure_logged_in, save_failure_screenshot
from tests.app._shared import pytest_runtest_makereport # noqa: F401
@pytest.fixture
def driver(shipper_ios_config, request):
"""货主苹果端 driver。"""
cfg = shipper_ios_config
d = None
try:
d = create_driver(cfg, platform="ios")
yield d
save_failure_screenshot(d, cfg, "ios", request)
finally:
if d is not None:
d.quit()
@pytest.fixture
def ensure_logged_in(shipper_ios_config, config):
"""确保已登录态(货主角色)。"""
fn = make_ensure_logged_in(shipper_ios_config, config, account_role="shipper")
return lambda d: fn(d)