【OpenHarmony】TDD-FUZZ环境配置

零、参考

1、AttributeError: 'ElementTree' object has no attribute 'getiterator':https://blog.csdn.net/suhao0911/article/details/110950742

一、创建工作目录

1、新建工作目录如:D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz。

2、gitee上下载 testfwk_developer_test-master、testfwk_xdevice-master。

3、将developer_test、xdevice压缩包解压到 D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz,并且目录重命名为developer_test、xdevice(必须重命名为xdevice)

https://gitee.com/openharmony/testfwk_xdevice/blob/master/config/user_config.xml

二、创建测试套目录 tests

在工作目录D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz下创建目录 tests用于存放 tdd、fuzz用例。

配置D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz\developer_test\config\usr_config.xml(指定test_cases为D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz\tests

三、下载TDD、FUZZ测试套

tdd、fuzz用例从版本里取构建详情 (openharmony.cn) :http://ci.openharmony.cn/workbench/cicd/dailybuild/detail/component

四、执行TDD、FUZZ测试

常用TDD测试命令

run -t UT -ts screen_capture_capi_unit_test

run -t UT -ts screen_capture_native_unit_test

run -t UT -ts screen_capture_capi_unit_test -tc ScreenCaptureUnitTest.screen_capture_save_file_02

run -t UT -ts screen_capture_capi_unit_test -tc ScreenCaptureUnitTest.screen_capture_specified_window_cb_01

run -t UT -ts screen_capture_capi_unit_test -tc ScreenCaptureUnitTest.screen_capture_save_file_cb_01

run -t UT -ts screen_capture_capi_unit_test -tc ScreenCaptureUnitTest.screen_capture_save_file_04

run -t UT -ts screen_capture_native_unit_test -tc ScreenCaptureUnitTest.screen_capture_specified_window_cb_01

run -t UT -ts screen_capture_native_unit_test -tc ScreenCaptureUnitTest.screen_capture_save_file_cb_01

run -t UT -ts screen_capture_native_unit_test -tc ScreenCaptureUnitTest.screen_capture_specified_window

TDD执行

run -t UT

run -t UT -ts screen_capture_capi_unit_test

run -t UT -ts screen_capture_capi_unit_test -tc ScreenCaptureUnitTest.screen_capture_specified_window_cb_01

FUZZ执行

run -t FUZZ

run -t FUZZ -ts PlayerStubFuzzTest

run -t FUZZ -ts PlayerStubFuzzTest -tc xxxxx.xxxx

问题1、exception: 'xml.etree.ElementTree.Element' object has no attribute 'getiterator'

Python版本问题(3.9 删除了getiterator接口,变成了iter):

2023-08-31 10:14:01,189\] \[196804\] \[Concurrent\] \[ERROR\] \[Device: 150100424a\*\*\*\*\*\*\*\*\*\*\*\*834bfb4900, exception: 'xml.etree.ElementTree.Element' object has no attribute 'getiterator'\] \[ErrorNo=00000

2023-08-31 10:14:01,190\] \[196804\] \[Concurrent\] \[INFO\] \[Executed: D:\\0000_TDD_FUZZ\\0000_ohos_tdd_fuzz\\tests\\fuzztest\\player_framework\\recorder\\RecorderSetVideoSizeFuzzTest, Execution Time: 2sec

全局搜索getiterator:grep -rns getiterator。将存在getiterator 的py文件里的getiterator替换为 iter。

developer_test/src/core/config/resource_manager.py:100: targets = root.getiterator("target")

Binary file developer_test/src/core/config/pycache/resource_manager.cpython-311.pyc matches

Binary file developer_test/src/core/config/pycache/resource_manager.cpython-39.pyc matches

xdevice/src/xdevice/_core/config/resource_manager.py:83: targets = root.getiterator("target")

Binary file xdevice/src/xdevice/_core/config/pycache/resource_manager.cpython-311.pyc matches

Binary file xdevice/src/xdevice/_core/config/pycache/resource_manager.cpython-39.pyc matches

全局搜索getiterator:grep -rns getiterator。将存在getiterator 的py文件里的getiterator替换为 iter。

developer_test/src/core/config/resource_manager.py:100: targets = root.getiterator("target")

Binary file developer_test/src/core/config/pycache/resource_manager.cpython-311.pyc matches

Binary file developer_test/src/core/config/pycache/resource_manager.cpython-39.pyc matches

xdevice/src/xdevice/_core/config/resource_manager.py:83: targets = root.getiterator("target")

Binary file xdevice/src/xdevice/_core/config/pycache/resource_manager.cpython-311.pyc matches

Binary file xdevice/src/xdevice/_core/config/pycache/resource_manager.cpython-39.pyc matches

相关推荐
黑臂麒麟2 天前
Electron&OpenHarmony 跨平台实战开发(bug):npm 安装 Electron 依赖常见错误排查
electron·npm·bug·openharmony
黑臂麒麟2 天前
Electron&OpenHarmony 跨平台实战开发(一):electron-vite 与 Vue3 架构搭建指南
前端·javascript·electron·openharmony
云雾J视界3 天前
敏捷实践组合破解芯片低功耗困局:迭代开发中如何精准控制功耗指标
人工智能·低功耗·敏捷实践·tdd·持续集成·软硬件协同·iot芯片
●VON3 天前
《不止于“开箱即用”:DevUI 表格与表单组件的高阶用法与避坑手册》
学习·华为·openharmony·表单·devui
●VON3 天前
《从零到企业级:基于 DevUI 的 B 端云控制台实战搭建指南》
学习·华为·openharmony·devui·企业级项目
●VON4 天前
Flutter for OpenHarmony前置知识《Flutter 路由与导航完整教程》
学习·flutter·华为·openharmony·开源鸿蒙
●VON4 天前
Flutter for OpenHarmony前置知识《Flutter 网络请求实战:从零实现一个完整的 API 测试页面》
学习·flutter·arm·openharmony·开源鸿蒙
A懿轩A5 天前
【2025版 OpenHarmony】 GitCode 口袋工具:Flutter + Dio 网路请求 打造随身的鸿蒙版 GitCode 搜索助手
windows·flutter·华为·鸿蒙·openharmony·开源鸿蒙
白茶三许5 天前
【OpenHarmony】Flutter 本地存储全解析:从键值对到数据库
数据库·flutter·开源·openharmony·gitcode
wei_shuo5 天前
基于 OpenHarmony 的 libzip 适配与交叉编译实践:构建系统、依赖管理与 HNP 打包全解析
openharmony·libzip