【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

相关推荐
软通动力14 小时前
软通动力携鸿湖万联与微展世签署战略合作协议,以开源鸿蒙赋能工业创新升级
开源·openharmony
软通动力2 天前
鸿蒙产业学院正式揭牌!软通动力与深信息签署校企合作框架协议
openharmony
Industio_触觉智能2 天前
【转】厚植根基,同启新程!一文回顾 2024 OpenHarmony 社区年度工作会议精彩瞬间
openharmony·开源鸿蒙
Hacker_Albert7 天前
OpenHarmony-7.IDL工具
openharmony
测试冲鸭13 天前
【理论】测试框架体系TDD、BDD、ATDD、DDT介绍
tdd
小马超会养兔子17 天前
如何下载OpenHarmony源码 + ssh连接
ssh·鸿蒙·openharmony
Moshow郑锴18 天前
什么是TDD测试驱动开发(Test Driven Development)?
驱动开发·tdd
xiangjiu9928719 天前
enzyme&jest TDD与BDD开发实战
tdd
Industio_触觉智能19 天前
OpenHarmony通过挂载镜像来修改镜像内容,RK3566鸿蒙开发板演示
开发板·openharmony·开源鸿蒙·瑞芯微·镜像挂载·修改镜像
Industio_触觉智能20 天前
OpenHarmony源码编译后烧录镜像教程,RK3566鸿蒙开发板演示
开发板·openharmony·rk3566·瑞芯微·编译固件