Metadata-Version: 2.4
Name: HA4T
Version: 0.1.3
Summary: 跨平台的UI自动化框架，适用于混合型app
Home-page: https://github.com/exuils/HA4T
Author: caishilong
Author-email: caishilong <caishilong@exuils.com>
License: Apache License 2.0
Keywords: automation,automated-test,game,android,ios,hybrid-app
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: colorlog
Requires-Dist: pillow
Requires-Dist: requests
Requires-Dist: uiautomator2
Requires-Dist: websockets
Requires-Dist: numpy
Requires-Dist: paddleocr
Requires-Dist: setuptools
Requires-Dist: six
Requires-Dist: wheel
Requires-Dist: tornado
Requires-Dist: logzero
Requires-Dist: logging-reset
Requires-Dist: adbutils
Requires-Dist: facebook-wda
Requires-Dist: paddlepaddle
Requires-Dist: tidevice
Requires-Dist: deepdiff
Requires-Dist: opencv-python
Requires-Dist: matplotlib
Requires-Dist: pytest
Requires-Dist: psutil
Requires-Dist: mock
Requires-Dist: allure-pytest
Requires-Dist: pywin32; sys_platform == "win32"
Requires-Dist: fastapi
Requires-Dist: uvicorn
Requires-Dist: aiofiles
Requires-Dist: hmdriver2
Requires-Dist: pyyaml
Requires-Dist: pydantic>=2
Provides-Extra: dev
Requires-Dist: flake8; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# HA4T 🐍

[![PyPI version](https://badge.fury.io/py/ha4t.svg)](https://badge.fury.io/py/ha4t)
[![Documentation Status](https://img.shields.io/badge/docs-latest-brightgreen)](https://exuils.github.io/HA4T/)

HA4T (Hybrid App For Testing Tool)
是一个跨平台的UI自动化框架，适用于混合型app、web和原生app等。该框架基于airtest
aircv模块、飞浆OCR、WS、uiautomator2和facebook_wda进行开发。
(目前仅个人开发和使用，可能存在一些问题~)

## 特性

- 跨平台支持：适用于iOS、Android和Web应用
- 多种定位方式：支持图像识别、OCR文字识别、webview定位、原生控件定位等
- 灵活的操作API：提供点击、滑动、输入等常用操作

## 安装

使用pip安装HA4T：

```bash
pip install ha4t
```

## 快速开始

以下是一个简单的示例，展示如何使用HA4T进行基本操作：

```python

# 原生定位
from ha4t import connect
from ha4t.api import *

connect(platform="android")

# 启动应用
start_app(activity="com.xxx.xxx.MainActivity", app_name="com.xxx.xxx")

# 等待
wait(text="添加新项目", timeout=30)

# orc 文字识别定位 中/英
click("添加新项目")
# 图像匹配定位
click(image="./添加新项目.png")
from ha4t.aircv.cv import Template

click(Template("./添加新项目.png"))
# u2 元素定位
click(text="添加新项目")

# webview 定位
from ha4t.cdp.cdp import CDP
from ha4t.cdp.server import CdpServer
from ha4t.cdp.by import By

cdp_server = CdpServer()
cdp_server.start_server_for_android_app(device.driver.adb_device)
cdp = CDP(cdp_server.ws_endpoint)

window = cdp.get_page(["homePage"])
time.sleep(3)
window.click((By.TEXT, "新建项目"))
```

## 详细文档(未完善)

查看[详细文档](https://exuils.github.io/HA4T/)以获取更多信息，包括：

- 完整的API参考
- 高级用法指南
- 最佳实践和技巧

## 问题和支持

如果您遇到任何问题或需要支持，请[提交一个issue](https://github.com/Exuils/HA4T/issues)。

## 许可证

本项目采用MIT许可证。详情请见[LICENSE](LICENSE)文件。

## 致谢

HA4T 的开发得益于以下开源项目：

- [airtest](https://github.com/NetEase/airtest)
- [uiautomator2](https://github.com/openatx/uiautomator2)
- [facebook-wda](https://github.com/openatx/facebook-wda)
- [paddleocr](https://github.com/PaddlePaddle/PaddleOCR)
- [ios-webkit-debug-proxy](https://github.com/google/ios-webkit-debug-proxy)
- [ui-viewer](https://github.com/codematrixer/ui-viewer) (MIT License) — 编辑器模块基于此项目二次开发

如果您觉得HA4T对您有帮助，请考虑给项目一个星标 ⭐️
