fix(conftest,config_loader): 修复 get_caps 的 Capabilities 加载逻辑

- 新增 pytest_addoption 增加 "--caps_name" 获取配置文件中的设备/平台名称
- 修复 get_caps 的 Capabilities 加载逻辑
- 优化 其他优化 enums.py
- 删除 移除部分文档,代码,第三方包(loguru)
This commit is contained in:
2026-02-28 16:08:14 +08:00
parent 332deb3666
commit 6ad6b7ff84
20 changed files with 175 additions and 328 deletions

View File

@@ -5,7 +5,7 @@
@author: CNWei,ChenWei
@Software: PyCharm
@contact: t6g888@163.com
@file: test_home
@file: wan_android_home
@date: 2026/1/30 17:18
@desc:
"""
@@ -28,8 +28,8 @@ class HomePage(BasePage):
tv_name = ("id", "com.manu.wanandroid:id/tvName")
account=("-android uiautomator",'new UiSelector().text("账号")')
pass_word=("-android uiautomator",'new UiSelector().text("密码")')
account = ("-android uiautomator", 'new UiSelector().text("账号")')
pass_word = ("-android uiautomator", 'new UiSelector().text("密码")')
login_button = ("accessibility id", '登录')
@@ -47,10 +47,10 @@ class HomePage(BasePage):
@allure.step("登录账号:{1}")
def login(self, username, password):
"""执行登录业务逻辑"""
account_element_id =self.find_element(*self.account).id
account_element_id = self.find_element(*self.account).id
account_input = {"elementId": account_element_id, "text": username}
pwd_element_id =self.find_element(*self.pass_word).id
pwd_element_id = self.find_element(*self.pass_word).id
pass_word_input = {"elementId": pwd_element_id, "text": password}
if self.wait_until_visible(*self.login_button):
@@ -61,5 +61,4 @@ class HomePage(BasePage):
if self.wait_until_visible(*self.tv_name):
self.full_screen_screenshot("登陆成功")
self.long_press(x=636,y=117,duration=300)
self.long_press(x=636, y=117, duration=300)

View File

@@ -5,7 +5,7 @@
@author: CNWei,ChenWei
@Software: PyCharm
@contact: t6g888@163.com
@file: test_views
@file: wan_android_project
@date: 2026/1/30 17:37
@desc:
"""
@@ -16,13 +16,15 @@ from appium import webdriver
from core.base_page import BasePage
from utils.decorators import StepTracer
logger = logging.getLogger(__name__)
class ProjectPage(BasePage):
# 定位参数
project_title = ("-android uiautomator", 'new UiSelector().text("项目")')
pro_table_title = ("-android uiautomator",'new UiSelector().text("完整项目")')
pro_table_title = ("-android uiautomator", 'new UiSelector().text("完整项目")')
def __init__(self, driver: webdriver.Remote):
super().__init__(driver)