**新增OCR功能,基于OCR进行页面元素识别、定位,解决了部分技术栈(如Flutter)下使用Poco无法对Android、iOS进行元素操作的问题。**
New Features
**1. 新增6个DSL API**
* ocr,全屏扫描
* click ocr text[{selector}],点击扫描文案[{selector}]
* in ocr[{selector}]input[{param2}],在扫描文字[{selector}]中输入[{param2}]
* ocr exist text[{selector}],扫描存在[{selector}]的文案
* ocr not exist text[{selector}],扫描不存在[{selector}]的文案
* page ocr complete find text[{selector}],页面扫描完成出现文字[{selector}]
OCR DSL[使用例子](https://github.com/ctripcorp/flybirds/blob/main/flybirds/template/features/test/android/base_cn_ocr.feature)
OCR支持的语言
语种 | 缩写 | | 语种 | 缩写 | | 语种 | 缩写
-- | -- | -- | -- | -- | -- | -- | --
中文 | ch | | 法文 | fr | | 日文 | japan
英文 | en | | 德文 | german | | 韩文 | korean
繁体中文 | chinese_cht | | 意大利文 | it | | 俄罗斯文 | ru
新增配置项
* "ocrLang" // ocr扫描语言,默认为ch简体中文
**2. 支持web端自定义page url rule**
以下是一个例子,修改文件`psscript/custom_handle/operation.py`
python
import os
from flybirds.utils import file_helper
def get_page_url(param):
path = os.path.join(os.getcwd(), "config", "schema_url.json")
if os.path.exists(path):
c_f = file_helper.get_json_from_file(path)
if c_f.__contains__(param):
return c_f.get(param)