【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

相关推荐
程序猿会指北1 天前
纯血鸿蒙APP实战开发——Text实现部分文本高亮和超链接样式
移动开发·harmonyos·arkts·openharmony·arkui·组件化·鸿蒙开发
程序猿会指北2 天前
纯血鸿蒙APP实战开发——应用新功能引导实现案例
移动开发·harmonyos·arkts·openharmony·arkui·组件化·鸿蒙开发
Hacker_Albert3 天前
OpenHarmony-3.HDF Display子系统(6)
openharmony
Hacker_Albert5 天前
OpenHarmony-4.HDI 框架
openharmony
神一样的老师8 天前
【鸿睿创智开发板试用】移植OpenCV 4到OpenHarmony 4.1
人工智能·opencv·计算机视觉·鸿蒙·openharmony
白羊@8 天前
多模块应用、发布使用第三方库(持续更新中)
服务器·前端·网络·harmonyos·鸿蒙·openharmony·第三方库
xianKOG13 天前
openHarHarmony学习
鸿蒙·openharmony
码莎拉蒂 .16 天前
NEXT开发应用质量建议与测试指南
openharmony
Industio_触觉智能21 天前
触觉智能亮相OpenHarmony人才生态大会2024
嵌入式硬件·openharmony·嵌入式开发·开源鸿蒙·鸿蒙开发·触觉智能·原生鸿蒙
软通动力23 天前
技术创新与人才培养并重 软通动力子公司鸿湖万联亮相OpenHarmony人才生态大会
openharmony