【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

相关推荐
Android技术栈11 小时前
鸿蒙数据防泄漏(DLP)【Data Loss Prevention Kit开发指导】
程序员·移动开发·数据安全·harmonyos·鸿蒙·openharmony·防泄漏
爱桥代码的程序媛12 小时前
鸿蒙开发管理:【@ohos.account.distributedAccount (分布式帐号管理)】
程序员·移动开发·harmonyos·鸿蒙·鸿蒙系统·openharmony·鸿蒙开发
andylauren21 小时前
Hi3861 OpenHarmony嵌入式应用入门--UDP Client
udp·openharmony
andylauren1 天前
Hi3861 OpenHarmony嵌入式应用入门--TCP Client
openharmony
andylauren2 天前
Hi3861 OpenHarmony嵌入式应用入门--wifi hotspot
openharmony
andylauren2 天前
Hi3861 OpenHarmony嵌入式应用入门--TCP Server
openharmony
Android技术栈2 天前
鸿蒙开发Ability Kit(程序访问控制):【安全控件概述】
程序员·移动开发·harmonyos·鸿蒙·openharmony·访问控制·安全控件
爱桥代码的程序媛2 天前
鸿蒙开发设备管理:【@ohos.vibrator (振动)】
程序员·移动开发·harmonyos·鸿蒙·鸿蒙系统·openharmony·设备管理
cooldream20093 天前
测试驱动开发(TDD)方法详解
驱动开发·tdd
andylauren4 天前
Hi3861 OpenHarmony嵌入式应用入门--UDP Server
udp·openharmony