- 新增 pytest_addoption 增加 "--caps_name" 获取配置文件中的设备/平台名称 - 修复 get_caps 的 Capabilities 加载逻辑 - 优化 其他优化 enums.py - 删除 移除部分文档,代码,第三方包(loguru)
42 lines
1.0 KiB
Python
42 lines
1.0 KiB
Python
#!/usr/bin/env python
|
|
# coding=utf-8
|
|
|
|
"""
|
|
@author: CNWei,ChenWei
|
|
@Software: PyCharm
|
|
@contact: t6g888@163.com
|
|
@file: wan_android_project
|
|
@date: 2026/1/30 17:37
|
|
@desc:
|
|
"""
|
|
import logging
|
|
|
|
import allure
|
|
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("完整项目")')
|
|
|
|
def __init__(self, driver: webdriver.Remote):
|
|
super().__init__(driver)
|
|
|
|
@allure.step("切换到“项目”页面")
|
|
def switch_to_project(self):
|
|
self.click(*self.project_title).attach_screenshot_bytes()
|
|
|
|
@allure.step("滑动切换“项目”内容")
|
|
@StepTracer("页面滑动")
|
|
def slide_views(self):
|
|
with allure.step("向左滑动3次"):
|
|
with StepTracer("开始划了"):
|
|
for _ in range(3):
|
|
self.swipe("left")
|