Kea2-python 0.3.0__tar.gz → 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of Kea2-python might be problematic. Click here for more details.

Files changed (45) hide show
  1. {kea2_python-0.3.0 → kea2_python-0.3.2}/Kea2_python.egg-info/PKG-INFO +71 -8
  2. {kea2_python-0.3.0 → kea2_python-0.3.2}/Kea2_python.egg-info/requires.txt +1 -0
  3. {kea2_python-0.3.0 → kea2_python-0.3.2}/PKG-INFO +71 -8
  4. {kea2_python-0.3.0 → kea2_python-0.3.2}/README.md +69 -7
  5. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/bug_report_generator.py +66 -75
  6. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/fastbotManager.py +3 -2
  7. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/keaUtils.py +11 -20
  8. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/report_merger.py +29 -16
  9. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/templates/bug_report_template.html +606 -285
  10. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/templates/merged_bug_report_template.html +1057 -355
  11. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/u2Driver.py +128 -5
  12. kea2_python-0.3.2/kea2/utils.py +112 -0
  13. {kea2_python-0.3.0 → kea2_python-0.3.2}/pyproject.toml +4 -2
  14. kea2_python-0.3.0/kea2/utils.py +0 -71
  15. {kea2_python-0.3.0 → kea2_python-0.3.2}/Kea2_python.egg-info/SOURCES.txt +0 -0
  16. {kea2_python-0.3.0 → kea2_python-0.3.2}/Kea2_python.egg-info/dependency_links.txt +0 -0
  17. {kea2_python-0.3.0 → kea2_python-0.3.2}/Kea2_python.egg-info/entry_points.txt +0 -0
  18. {kea2_python-0.3.0 → kea2_python-0.3.2}/Kea2_python.egg-info/top_level.txt +0 -0
  19. {kea2_python-0.3.0 → kea2_python-0.3.2}/LICENSE +0 -0
  20. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/__init__.py +0 -0
  21. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/absDriver.py +0 -0
  22. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/adbUtils.py +0 -0
  23. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/fastbot-thirdpart.jar +0 -0
  24. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/fastbot_configs/abl.strings +0 -0
  25. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/fastbot_configs/awl.strings +0 -0
  26. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/fastbot_configs/max.config +0 -0
  27. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/fastbot_configs/max.fuzzing.strings +0 -0
  28. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/fastbot_configs/max.schema.strings +0 -0
  29. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/fastbot_configs/max.strings +0 -0
  30. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/fastbot_configs/max.tree.pruning +0 -0
  31. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/fastbot_configs/widget.block.py +0 -0
  32. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/fastbot_libs/arm64-v8a/libfastbot_native.so +0 -0
  33. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/fastbot_libs/armeabi-v7a/libfastbot_native.so +0 -0
  34. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/fastbot_libs/x86/libfastbot_native.so +0 -0
  35. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/fastbot_libs/x86_64/libfastbot_native.so +0 -0
  36. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/framework.jar +0 -0
  37. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/kea2-thirdpart.jar +0 -0
  38. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/monkeyq.jar +0 -0
  39. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/assets/quicktest.py +0 -0
  40. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/cli.py +0 -0
  41. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/kea_launcher.py +0 -0
  42. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/logWatcher.py +0 -0
  43. {kea2_python-0.3.0 → kea2_python-0.3.2}/kea2/resultSyncer.py +0 -0
  44. {kea2_python-0.3.0 → kea2_python-0.3.2}/setup.cfg +0 -0
  45. {kea2_python-0.3.0 → kea2_python-0.3.2}/tests/test_u2Selector.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Kea2-python
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: A python library for supporting and customizing automated UI testing for mobile apps
5
5
  Author-email: Xixian Liang <xixian@stu.ecnu.edu.cn>
6
6
  Requires-Python: >=3.8
@@ -10,6 +10,7 @@ Requires-Dist: rtree>=1.3.0
10
10
  Requires-Dist: jinja2>=3.0.0
11
11
  Requires-Dist: uiautomator2>=3.3.3
12
12
  Requires-Dist: adbutils>=2.9.3
13
+ Requires-Dist: setuptools>=75.3.2
13
14
  Dynamic: license-file
14
15
 
15
16
 
@@ -17,6 +18,7 @@ Dynamic: license-file
17
18
  [![PyPI](https://img.shields.io/pypi/v/kea2-python.svg)](https://pypi.python.org/pypi/kea2-python)
18
19
  [![PyPI Downloads](https://static.pepy.tech/badge/kea2-python)](https://pepy.tech/projects/kea2-python)
19
20
  ![Python](https://img.shields.io/badge/python-3.8%2B-blue)
21
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/ecnusse/Kea2)
20
22
 
21
23
  <div>
22
24
  <img src="https://github.com/user-attachments/assets/84e47b87-2dd2-4d7e-91d1-e8c1d1db0cf4" style="border-radius: 14px; width: 20%; height: 20%;"/>
@@ -31,6 +33,13 @@ The group has reached its capacity. Please contact Xixian Liang at [xixian@stu.e
31
33
 
32
34
  ## About
33
35
 
36
+ <div align="center">
37
+ <img src="docs/images/kea2_logo.png" alt="kea_logo" style="border-radius: 14px; width: 20%; height: 20%;"/>
38
+ </div>
39
+ <div align="center">
40
+ <a href="https://en.wikipedia.org/wiki/Kea">Kea2's logo: A large parrot skilled in finding "bugs"</a>
41
+ </div>
42
+
34
43
  Kea2 is an easy-to-use tool for fuzzing mobile apps. Its key *novelty* is able to fuse automated UI testing with scripts (usually written by human), thus empowering automated UI testing with human intelligence for effectively finding *crashing bugs* as well as *non-crashing functional (logic) bugs*.
35
44
 
36
45
  Kea2 is currently built on top of [Fastbot](https://github.com/bytedance/Fastbot_Android), *an industrial-strength automated UI testing tool*, and [uiautomator2](https://github.com/openatx/uiautomator2), *an easy-to-use and stable Android automation library*.
@@ -40,7 +49,7 @@ Kea2 currently targets [Android](https://en.wikipedia.org/wiki/Android_(operatin
40
49
 
41
50
  <div align="center">
42
51
  <div style="max-width:80%; max-height:80%">
43
- <img src="docs/intro.png" style="border-radius: 14px; width: 80%; height: 80%;"/>
52
+ <img src="docs/images/intro.png" style="border-radius: 14px; width: 80%; height: 80%;"/>
44
53
  </div>
45
54
  </div>
46
55
 
@@ -60,11 +69,17 @@ Kea2 currently targets [Android](https://en.wikipedia.org/wiki/Android_(operatin
60
69
  | **Finding crashes in deep states** | | :+1: | :+1: |
61
70
  | **Finding non-crashing functional (logic) bugs** | | | :+1: |
62
71
 
63
- ## Kea2's Known Users
72
+ ## Kea2's Users
73
+
74
+ Kea2 (and its idea) has been used/integrated by
64
75
 
65
- [OPay Business](https://play.google.com/store/apps/details?id=team.opay.pay.merchant.service) --- a financial & payment app
76
+ - [OPay Business](https://play.google.com/store/apps/details?id=team.opay.pay.merchant.service) --- a financial & payment app. OPay uses Kea2 for regression testing on POS machines and mobile devices.
66
77
 
67
- We are glad to hear if you are using Kea2 for your app.
78
+ - [WeChat's iExplorer]() --- WeChat's in-house testing platform
79
+
80
+ - [ByteDance's Fastbot](https://github.com/bytedance/Fastbot_Android)
81
+
82
+ Please let us know and willing to hear your feedback/questions if you are also using Kea2.
68
83
 
69
84
  ## Design & Roadmap
70
85
  Kea2 currently works with:
@@ -82,7 +97,7 @@ In the future, Kea2 will be extended to support
82
97
 
83
98
  Running environment:
84
99
  - support Windows, MacOS and Linux
85
- - python 3.8+, Android 5.0+ (Android SDK installed)
100
+ - python 3.8+, Android 5.0~16.0 (Android SDK installed)
86
101
  - **VPN closed** (Features 2 and 3 required)
87
102
 
88
103
  Install Kea2 by `pip`:
@@ -193,7 +208,7 @@ In Feature 3, a script is composed of three elements:
193
208
  In a social media app, message sending is a common feature. On the message sending page, the `send` button should always appears when the input box is not empty (i.e., has some message).
194
209
 
195
210
  <div align="center">
196
- <img src="docs/socialAppBug.png" style="border-radius: 14px; width:30%; height:40%;"/>
211
+ <img src="docs/images/socialAppBug.png" style="border-radius: 14px; width:30%; height:40%;"/>
197
212
  </div>
198
213
 
199
214
  <div align="center">
@@ -230,7 +245,55 @@ You can find the [user manual](docs/manual_en.md), which includes:
230
245
  - How to run Kea2 and Kea2's command line options
231
246
  - How to find and understand Kea2's testing results
232
247
  - How to [whitelist or blacklist](docs/blacklisting.md) specific activities, UI widgets and UI regions during fuzzing
233
- - [Common Q&A for PBT and Kea2](https://sy8pzmhmun.feishu.cn/wiki/SLGwwqgzIiEuC3kwmV8cSZY0nTg?from=from_copylink)
248
+ - [Q&A for Kea2 and PBT (对Kea2和PBT技术的常见问题和回答)](https://sy8pzmhmun.feishu.cn/wiki/SLGwwqgzIiEuC3kwmV8cSZY0nTg?from=from_copylink)
249
+
250
+ Some blogs on Kea/Kea2 (in Chinese):
251
+ - [别再苦哈哈写测试脚本了,生成它们吧!(一)](https://mp.weixin.qq.com/s/R2kLCkXpDjpa8wCX4Eidtg)
252
+ - [别再苦哈哈写测试脚本了,生成它们吧!(二)](https://mp.weixin.qq.com/s/s4WkdstNcKupu9OP8jeOXw)
253
+ - [别再苦哈哈写测试脚本了,生成它们吧!(三)](https://mp.weixin.qq.com/s/BjXyo-xJRmPB_sCc4pmh8g)
254
+ - [2025 Let’s GoSSIP 软件安全暑期学校预告第一弹——Kea2](https://mp.weixin.qq.com/s/8_0_GNNin8E5BqTbJU33wg)
255
+ - [功能性质驱动的测试技术:下一代GUI自动化测试技术](https://appw8oh6ysg4044.xet.citv.cn/p/course/video/v_6882fa14e4b0694ca0ec0a1b) --- 视频回放&PPT@MTSC 2025
256
+
257
+ 工业界对Kea2的理解和评价(点击箭头查看详情):
258
+
259
+ <details>
260
+ <summary>Kea2的性质是什么含义?Kea2意义和价值是什么?</summary>
261
+
262
+ kea2 其实是一个工具,它是python+u2+fastbot的集合体。 它本身更像是一台装好了发动机和轮子的汽车底盘。
263
+
264
+ 性质是苏老师他们团队提出的一个概念, 转换到测试领域的实际工作中,性质对应的是最小单位的功能(原子级功能),性质的依赖条件很少或没有,它可以自身运行。一个典型的性质就是登录,它仅仅具有输入用户名,输入密码,提交。再举个例子,给视频点个赞,也就是简单的两三步。就是一个性质。
265
+
266
+ 性质与kea2结合的意义是在于解决过去使用appium过重的问题。用appium去测试一个性质通常要写很多行的代码,引导界面到达性质的位置。但使用kea2,就只需要编写性质,如何到其所在的位置是交给fastbot和它的学习算法来搞定的。
267
+
268
+ kea2另个重大的价值是,它解决了上述思想所需要的技术支撑,比appium更轻量的UI编写方式,fastbot编写性质的能力不足,以及无法编写逻辑和断言。整体上是保留了fastbot以往的优秀品质,完善了其不足和短板。
269
+
270
+ 简而言之,需要做传统的编排型的功能测试,仍然使用appium,使用kea2也行,但你感觉不到它的价值。本身有需要做混沌测试,模糊测试,兼容性测试。那么强烈,强烈推荐kea2。kea2更偏探索性测试而非编排型。
271
+ </details>
272
+
273
+ <details>
274
+ <summary>kea2组成是什么?kea2的核心作用?kea2做了什么?</summary>
275
+
276
+ kea2 组成:
277
+
278
+ fastbot -- fuzz测试引擎,负责跑路。
279
+ u2 -- 负责进行业务空间的操作。与使用selenium,appium,没什么区别。
280
+ python -- u2的操作,逻辑的编写,定制化的实现。
281
+
282
+ kea2的核心作用:
283
+
284
+ 提供了条件触发器。 在FB跑路的时候,会不停遍历条件触发器,一旦触发,挂起FB,开始执行触发器指定的 ui test 及 assert。执行完毕,继续切回FB跑路。
285
+
286
+ hea2做了什么:
287
+
288
+ 替换了FB的条件触发功能。
289
+ 替换了FB的黑名单,黑控件功能。
290
+ 替换了FB剪枝功能。
291
+ 增加了多元化的元素空间操作能力。
292
+ 增加了fuzz测试中的 逻辑设定。
293
+ 增加了断言能力。
294
+ 增加了元素操作能力。
295
+ </details>
296
+
234
297
 
235
298
  ## Open-source projects used by Kea2
236
299
 
@@ -2,3 +2,4 @@ rtree>=1.3.0
2
2
  jinja2>=3.0.0
3
3
  uiautomator2>=3.3.3
4
4
  adbutils>=2.9.3
5
+ setuptools>=75.3.2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Kea2-python
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: A python library for supporting and customizing automated UI testing for mobile apps
5
5
  Author-email: Xixian Liang <xixian@stu.ecnu.edu.cn>
6
6
  Requires-Python: >=3.8
@@ -10,6 +10,7 @@ Requires-Dist: rtree>=1.3.0
10
10
  Requires-Dist: jinja2>=3.0.0
11
11
  Requires-Dist: uiautomator2>=3.3.3
12
12
  Requires-Dist: adbutils>=2.9.3
13
+ Requires-Dist: setuptools>=75.3.2
13
14
  Dynamic: license-file
14
15
 
15
16
 
@@ -17,6 +18,7 @@ Dynamic: license-file
17
18
  [![PyPI](https://img.shields.io/pypi/v/kea2-python.svg)](https://pypi.python.org/pypi/kea2-python)
18
19
  [![PyPI Downloads](https://static.pepy.tech/badge/kea2-python)](https://pepy.tech/projects/kea2-python)
19
20
  ![Python](https://img.shields.io/badge/python-3.8%2B-blue)
21
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/ecnusse/Kea2)
20
22
 
21
23
  <div>
22
24
  <img src="https://github.com/user-attachments/assets/84e47b87-2dd2-4d7e-91d1-e8c1d1db0cf4" style="border-radius: 14px; width: 20%; height: 20%;"/>
@@ -31,6 +33,13 @@ The group has reached its capacity. Please contact Xixian Liang at [xixian@stu.e
31
33
 
32
34
  ## About
33
35
 
36
+ <div align="center">
37
+ <img src="docs/images/kea2_logo.png" alt="kea_logo" style="border-radius: 14px; width: 20%; height: 20%;"/>
38
+ </div>
39
+ <div align="center">
40
+ <a href="https://en.wikipedia.org/wiki/Kea">Kea2's logo: A large parrot skilled in finding "bugs"</a>
41
+ </div>
42
+
34
43
  Kea2 is an easy-to-use tool for fuzzing mobile apps. Its key *novelty* is able to fuse automated UI testing with scripts (usually written by human), thus empowering automated UI testing with human intelligence for effectively finding *crashing bugs* as well as *non-crashing functional (logic) bugs*.
35
44
 
36
45
  Kea2 is currently built on top of [Fastbot](https://github.com/bytedance/Fastbot_Android), *an industrial-strength automated UI testing tool*, and [uiautomator2](https://github.com/openatx/uiautomator2), *an easy-to-use and stable Android automation library*.
@@ -40,7 +49,7 @@ Kea2 currently targets [Android](https://en.wikipedia.org/wiki/Android_(operatin
40
49
 
41
50
  <div align="center">
42
51
  <div style="max-width:80%; max-height:80%">
43
- <img src="docs/intro.png" style="border-radius: 14px; width: 80%; height: 80%;"/>
52
+ <img src="docs/images/intro.png" style="border-radius: 14px; width: 80%; height: 80%;"/>
44
53
  </div>
45
54
  </div>
46
55
 
@@ -60,11 +69,17 @@ Kea2 currently targets [Android](https://en.wikipedia.org/wiki/Android_(operatin
60
69
  | **Finding crashes in deep states** | | :+1: | :+1: |
61
70
  | **Finding non-crashing functional (logic) bugs** | | | :+1: |
62
71
 
63
- ## Kea2's Known Users
72
+ ## Kea2's Users
73
+
74
+ Kea2 (and its idea) has been used/integrated by
64
75
 
65
- [OPay Business](https://play.google.com/store/apps/details?id=team.opay.pay.merchant.service) --- a financial & payment app
76
+ - [OPay Business](https://play.google.com/store/apps/details?id=team.opay.pay.merchant.service) --- a financial & payment app. OPay uses Kea2 for regression testing on POS machines and mobile devices.
66
77
 
67
- We are glad to hear if you are using Kea2 for your app.
78
+ - [WeChat's iExplorer]() --- WeChat's in-house testing platform
79
+
80
+ - [ByteDance's Fastbot](https://github.com/bytedance/Fastbot_Android)
81
+
82
+ Please let us know and willing to hear your feedback/questions if you are also using Kea2.
68
83
 
69
84
  ## Design & Roadmap
70
85
  Kea2 currently works with:
@@ -82,7 +97,7 @@ In the future, Kea2 will be extended to support
82
97
 
83
98
  Running environment:
84
99
  - support Windows, MacOS and Linux
85
- - python 3.8+, Android 5.0+ (Android SDK installed)
100
+ - python 3.8+, Android 5.0~16.0 (Android SDK installed)
86
101
  - **VPN closed** (Features 2 and 3 required)
87
102
 
88
103
  Install Kea2 by `pip`:
@@ -193,7 +208,7 @@ In Feature 3, a script is composed of three elements:
193
208
  In a social media app, message sending is a common feature. On the message sending page, the `send` button should always appears when the input box is not empty (i.e., has some message).
194
209
 
195
210
  <div align="center">
196
- <img src="docs/socialAppBug.png" style="border-radius: 14px; width:30%; height:40%;"/>
211
+ <img src="docs/images/socialAppBug.png" style="border-radius: 14px; width:30%; height:40%;"/>
197
212
  </div>
198
213
 
199
214
  <div align="center">
@@ -230,7 +245,55 @@ You can find the [user manual](docs/manual_en.md), which includes:
230
245
  - How to run Kea2 and Kea2's command line options
231
246
  - How to find and understand Kea2's testing results
232
247
  - How to [whitelist or blacklist](docs/blacklisting.md) specific activities, UI widgets and UI regions during fuzzing
233
- - [Common Q&A for PBT and Kea2](https://sy8pzmhmun.feishu.cn/wiki/SLGwwqgzIiEuC3kwmV8cSZY0nTg?from=from_copylink)
248
+ - [Q&A for Kea2 and PBT (对Kea2和PBT技术的常见问题和回答)](https://sy8pzmhmun.feishu.cn/wiki/SLGwwqgzIiEuC3kwmV8cSZY0nTg?from=from_copylink)
249
+
250
+ Some blogs on Kea/Kea2 (in Chinese):
251
+ - [别再苦哈哈写测试脚本了,生成它们吧!(一)](https://mp.weixin.qq.com/s/R2kLCkXpDjpa8wCX4Eidtg)
252
+ - [别再苦哈哈写测试脚本了,生成它们吧!(二)](https://mp.weixin.qq.com/s/s4WkdstNcKupu9OP8jeOXw)
253
+ - [别再苦哈哈写测试脚本了,生成它们吧!(三)](https://mp.weixin.qq.com/s/BjXyo-xJRmPB_sCc4pmh8g)
254
+ - [2025 Let’s GoSSIP 软件安全暑期学校预告第一弹——Kea2](https://mp.weixin.qq.com/s/8_0_GNNin8E5BqTbJU33wg)
255
+ - [功能性质驱动的测试技术:下一代GUI自动化测试技术](https://appw8oh6ysg4044.xet.citv.cn/p/course/video/v_6882fa14e4b0694ca0ec0a1b) --- 视频回放&PPT@MTSC 2025
256
+
257
+ 工业界对Kea2的理解和评价(点击箭头查看详情):
258
+
259
+ <details>
260
+ <summary>Kea2的性质是什么含义?Kea2意义和价值是什么?</summary>
261
+
262
+ kea2 其实是一个工具,它是python+u2+fastbot的集合体。 它本身更像是一台装好了发动机和轮子的汽车底盘。
263
+
264
+ 性质是苏老师他们团队提出的一个概念, 转换到测试领域的实际工作中,性质对应的是最小单位的功能(原子级功能),性质的依赖条件很少或没有,它可以自身运行。一个典型的性质就是登录,它仅仅具有输入用户名,输入密码,提交。再举个例子,给视频点个赞,也就是简单的两三步。就是一个性质。
265
+
266
+ 性质与kea2结合的意义是在于解决过去使用appium过重的问题。用appium去测试一个性质通常要写很多行的代码,引导界面到达性质的位置。但使用kea2,就只需要编写性质,如何到其所在的位置是交给fastbot和它的学习算法来搞定的。
267
+
268
+ kea2另个重大的价值是,它解决了上述思想所需要的技术支撑,比appium更轻量的UI编写方式,fastbot编写性质的能力不足,以及无法编写逻辑和断言。整体上是保留了fastbot以往的优秀品质,完善了其不足和短板。
269
+
270
+ 简而言之,需要做传统的编排型的功能测试,仍然使用appium,使用kea2也行,但你感觉不到它的价值。本身有需要做混沌测试,模糊测试,兼容性测试。那么强烈,强烈推荐kea2。kea2更偏探索性测试而非编排型。
271
+ </details>
272
+
273
+ <details>
274
+ <summary>kea2组成是什么?kea2的核心作用?kea2做了什么?</summary>
275
+
276
+ kea2 组成:
277
+
278
+ fastbot -- fuzz测试引擎,负责跑路。
279
+ u2 -- 负责进行业务空间的操作。与使用selenium,appium,没什么区别。
280
+ python -- u2的操作,逻辑的编写,定制化的实现。
281
+
282
+ kea2的核心作用:
283
+
284
+ 提供了条件触发器。 在FB跑路的时候,会不停遍历条件触发器,一旦触发,挂起FB,开始执行触发器指定的 ui test 及 assert。执行完毕,继续切回FB跑路。
285
+
286
+ hea2做了什么:
287
+
288
+ 替换了FB的条件触发功能。
289
+ 替换了FB的黑名单,黑控件功能。
290
+ 替换了FB剪枝功能。
291
+ 增加了多元化的元素空间操作能力。
292
+ 增加了fuzz测试中的 逻辑设定。
293
+ 增加了断言能力。
294
+ 增加了元素操作能力。
295
+ </details>
296
+
234
297
 
235
298
  ## Open-source projects used by Kea2
236
299
 
@@ -3,6 +3,7 @@
3
3
  [![PyPI](https://img.shields.io/pypi/v/kea2-python.svg)](https://pypi.python.org/pypi/kea2-python)
4
4
  [![PyPI Downloads](https://static.pepy.tech/badge/kea2-python)](https://pepy.tech/projects/kea2-python)
5
5
  ![Python](https://img.shields.io/badge/python-3.8%2B-blue)
6
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/ecnusse/Kea2)
6
7
 
7
8
  <div>
8
9
  <img src="https://github.com/user-attachments/assets/84e47b87-2dd2-4d7e-91d1-e8c1d1db0cf4" style="border-radius: 14px; width: 20%; height: 20%;"/>
@@ -17,6 +18,13 @@ The group has reached its capacity. Please contact Xixian Liang at [xixian@stu.e
17
18
 
18
19
  ## About
19
20
 
21
+ <div align="center">
22
+ <img src="docs/images/kea2_logo.png" alt="kea_logo" style="border-radius: 14px; width: 20%; height: 20%;"/>
23
+ </div>
24
+ <div align="center">
25
+ <a href="https://en.wikipedia.org/wiki/Kea">Kea2's logo: A large parrot skilled in finding "bugs"</a>
26
+ </div>
27
+
20
28
  Kea2 is an easy-to-use tool for fuzzing mobile apps. Its key *novelty* is able to fuse automated UI testing with scripts (usually written by human), thus empowering automated UI testing with human intelligence for effectively finding *crashing bugs* as well as *non-crashing functional (logic) bugs*.
21
29
 
22
30
  Kea2 is currently built on top of [Fastbot](https://github.com/bytedance/Fastbot_Android), *an industrial-strength automated UI testing tool*, and [uiautomator2](https://github.com/openatx/uiautomator2), *an easy-to-use and stable Android automation library*.
@@ -26,7 +34,7 @@ Kea2 currently targets [Android](https://en.wikipedia.org/wiki/Android_(operatin
26
34
 
27
35
  <div align="center">
28
36
  <div style="max-width:80%; max-height:80%">
29
- <img src="docs/intro.png" style="border-radius: 14px; width: 80%; height: 80%;"/>
37
+ <img src="docs/images/intro.png" style="border-radius: 14px; width: 80%; height: 80%;"/>
30
38
  </div>
31
39
  </div>
32
40
 
@@ -46,11 +54,17 @@ Kea2 currently targets [Android](https://en.wikipedia.org/wiki/Android_(operatin
46
54
  | **Finding crashes in deep states** | | :+1: | :+1: |
47
55
  | **Finding non-crashing functional (logic) bugs** | | | :+1: |
48
56
 
49
- ## Kea2's Known Users
57
+ ## Kea2's Users
58
+
59
+ Kea2 (and its idea) has been used/integrated by
50
60
 
51
- [OPay Business](https://play.google.com/store/apps/details?id=team.opay.pay.merchant.service) --- a financial & payment app
61
+ - [OPay Business](https://play.google.com/store/apps/details?id=team.opay.pay.merchant.service) --- a financial & payment app. OPay uses Kea2 for regression testing on POS machines and mobile devices.
52
62
 
53
- We are glad to hear if you are using Kea2 for your app.
63
+ - [WeChat's iExplorer]() --- WeChat's in-house testing platform
64
+
65
+ - [ByteDance's Fastbot](https://github.com/bytedance/Fastbot_Android)
66
+
67
+ Please let us know and willing to hear your feedback/questions if you are also using Kea2.
54
68
 
55
69
  ## Design & Roadmap
56
70
  Kea2 currently works with:
@@ -68,7 +82,7 @@ In the future, Kea2 will be extended to support
68
82
 
69
83
  Running environment:
70
84
  - support Windows, MacOS and Linux
71
- - python 3.8+, Android 5.0+ (Android SDK installed)
85
+ - python 3.8+, Android 5.0~16.0 (Android SDK installed)
72
86
  - **VPN closed** (Features 2 and 3 required)
73
87
 
74
88
  Install Kea2 by `pip`:
@@ -179,7 +193,7 @@ In Feature 3, a script is composed of three elements:
179
193
  In a social media app, message sending is a common feature. On the message sending page, the `send` button should always appears when the input box is not empty (i.e., has some message).
180
194
 
181
195
  <div align="center">
182
- <img src="docs/socialAppBug.png" style="border-radius: 14px; width:30%; height:40%;"/>
196
+ <img src="docs/images/socialAppBug.png" style="border-radius: 14px; width:30%; height:40%;"/>
183
197
  </div>
184
198
 
185
199
  <div align="center">
@@ -216,7 +230,55 @@ You can find the [user manual](docs/manual_en.md), which includes:
216
230
  - How to run Kea2 and Kea2's command line options
217
231
  - How to find and understand Kea2's testing results
218
232
  - How to [whitelist or blacklist](docs/blacklisting.md) specific activities, UI widgets and UI regions during fuzzing
219
- - [Common Q&A for PBT and Kea2](https://sy8pzmhmun.feishu.cn/wiki/SLGwwqgzIiEuC3kwmV8cSZY0nTg?from=from_copylink)
233
+ - [Q&A for Kea2 and PBT (对Kea2和PBT技术的常见问题和回答)](https://sy8pzmhmun.feishu.cn/wiki/SLGwwqgzIiEuC3kwmV8cSZY0nTg?from=from_copylink)
234
+
235
+ Some blogs on Kea/Kea2 (in Chinese):
236
+ - [别再苦哈哈写测试脚本了,生成它们吧!(一)](https://mp.weixin.qq.com/s/R2kLCkXpDjpa8wCX4Eidtg)
237
+ - [别再苦哈哈写测试脚本了,生成它们吧!(二)](https://mp.weixin.qq.com/s/s4WkdstNcKupu9OP8jeOXw)
238
+ - [别再苦哈哈写测试脚本了,生成它们吧!(三)](https://mp.weixin.qq.com/s/BjXyo-xJRmPB_sCc4pmh8g)
239
+ - [2025 Let’s GoSSIP 软件安全暑期学校预告第一弹——Kea2](https://mp.weixin.qq.com/s/8_0_GNNin8E5BqTbJU33wg)
240
+ - [功能性质驱动的测试技术:下一代GUI自动化测试技术](https://appw8oh6ysg4044.xet.citv.cn/p/course/video/v_6882fa14e4b0694ca0ec0a1b) --- 视频回放&PPT@MTSC 2025
241
+
242
+ 工业界对Kea2的理解和评价(点击箭头查看详情):
243
+
244
+ <details>
245
+ <summary>Kea2的性质是什么含义?Kea2意义和价值是什么?</summary>
246
+
247
+ kea2 其实是一个工具,它是python+u2+fastbot的集合体。 它本身更像是一台装好了发动机和轮子的汽车底盘。
248
+
249
+ 性质是苏老师他们团队提出的一个概念, 转换到测试领域的实际工作中,性质对应的是最小单位的功能(原子级功能),性质的依赖条件很少或没有,它可以自身运行。一个典型的性质就是登录,它仅仅具有输入用户名,输入密码,提交。再举个例子,给视频点个赞,也就是简单的两三步。就是一个性质。
250
+
251
+ 性质与kea2结合的意义是在于解决过去使用appium过重的问题。用appium去测试一个性质通常要写很多行的代码,引导界面到达性质的位置。但使用kea2,就只需要编写性质,如何到其所在的位置是交给fastbot和它的学习算法来搞定的。
252
+
253
+ kea2另个重大的价值是,它解决了上述思想所需要的技术支撑,比appium更轻量的UI编写方式,fastbot编写性质的能力不足,以及无法编写逻辑和断言。整体上是保留了fastbot以往的优秀品质,完善了其不足和短板。
254
+
255
+ 简而言之,需要做传统的编排型的功能测试,仍然使用appium,使用kea2也行,但你感觉不到它的价值。本身有需要做混沌测试,模糊测试,兼容性测试。那么强烈,强烈推荐kea2。kea2更偏探索性测试而非编排型。
256
+ </details>
257
+
258
+ <details>
259
+ <summary>kea2组成是什么?kea2的核心作用?kea2做了什么?</summary>
260
+
261
+ kea2 组成:
262
+
263
+ fastbot -- fuzz测试引擎,负责跑路。
264
+ u2 -- 负责进行业务空间的操作。与使用selenium,appium,没什么区别。
265
+ python -- u2的操作,逻辑的编写,定制化的实现。
266
+
267
+ kea2的核心作用:
268
+
269
+ 提供了条件触发器。 在FB跑路的时候,会不停遍历条件触发器,一旦触发,挂起FB,开始执行触发器指定的 ui test 及 assert。执行完毕,继续切回FB跑路。
270
+
271
+ hea2做了什么:
272
+
273
+ 替换了FB的条件触发功能。
274
+ 替换了FB的黑名单,黑控件功能。
275
+ 替换了FB剪枝功能。
276
+ 增加了多元化的元素空间操作能力。
277
+ 增加了fuzz测试中的 逻辑设定。
278
+ 增加了断言能力。
279
+ 增加了元素操作能力。
280
+ </details>
281
+
220
282
 
221
283
  ## Open-source projects used by Kea2
222
284
 
@@ -9,7 +9,7 @@ from concurrent.futures import ThreadPoolExecutor
9
9
 
10
10
  from PIL import Image, ImageDraw, ImageFont
11
11
  from jinja2 import Environment, FileSystemLoader, select_autoescape, PackageLoader
12
- from kea2.utils import getLogger
12
+ from kea2.utils import getLogger, catchException
13
13
 
14
14
  logger = getLogger(__name__)
15
15
 
@@ -421,27 +421,24 @@ class BugReportGenerator:
421
421
  step_data["Info"] = json.loads(step_data["Info"])
422
422
  return step_data
423
423
 
424
+ @catchException("Error when marking screenshot")
424
425
  def _mark_screenshot(self, step_data: StepData):
425
- try:
426
- step_type = step_data["Type"]
427
- screenshot_name = step_data["Screenshot"]
428
- if not screenshot_name:
429
- return
430
-
431
- if step_type == "Monkey":
432
- act = step_data["Info"].get("act")
433
- pos = step_data["Info"].get("pos")
434
- if act in ["CLICK", "LONG_CLICK"] or act.startswith("SCROLL"):
435
- self._mark_screenshot_interaction(step_type, screenshot_name, act, pos)
436
-
437
- elif step_type == "Script":
438
- act = step_data["Info"].get("method")
439
- pos = step_data["Info"].get("params")
440
- if act in ["click", "setText", "swipe"]:
441
- self._mark_screenshot_interaction(step_type, screenshot_name, act, pos)
426
+ step_type = step_data["Type"]
427
+ screenshot_name = step_data["Screenshot"]
428
+ if not screenshot_name:
429
+ return
442
430
 
443
- except Exception as e:
444
- logger.error(f"Error when marking screenshots: {e}")
431
+ if step_type == "Monkey":
432
+ act = step_data["Info"].get("act")
433
+ pos = step_data["Info"].get("pos")
434
+ if act in ["CLICK", "LONG_CLICK"] or act.startswith("SCROLL"):
435
+ self._mark_screenshot_interaction(step_type, screenshot_name, act, pos)
436
+
437
+ elif step_type == "Script":
438
+ act = step_data["Info"].get("method")
439
+ pos = step_data["Info"].get("params")
440
+ if act in ["click", "setText", "swipe"]:
441
+ self._mark_screenshot_interaction(step_type, screenshot_name, act, pos)
445
442
 
446
443
 
447
444
  def _mark_screenshot_interaction(self, step_type: str, screenshot_name: str, action_type: str, position: Union[List, Tuple]) -> bool:
@@ -528,65 +525,61 @@ class BugReportGenerator:
528
525
  img.save(screenshot_path)
529
526
  return True
530
527
 
528
+ @catchException("Error rendering template")
531
529
  def _generate_html_report(self, data: ReportData):
532
530
  """
533
531
  Generate HTML format bug report
534
532
  """
535
- try:
536
- # Format timestamp for display
537
- timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
538
-
539
- # Ensure coverage_trend has data
540
- if not data["coverage_trend"]:
541
- logger.warning("No coverage trend data")
542
- # Use the same field names as in coverage.log file
543
- data["coverage_trend"] = [{"stepsCount": 0, "coverage": 0, "testedActivitiesCount": 0}]
544
-
545
- # Convert coverage_trend to JSON string, ensuring all data points are included
546
- coverage_trend_json = json.dumps(data["coverage_trend"])
547
- logger.debug(f"Number of coverage trend data points: {len(data['coverage_trend'])}")
548
-
549
- # Prepare template data
550
- template_data = {
551
- 'timestamp': timestamp,
552
- 'bugs_found': data["bugs_found"],
553
- 'total_testing_time': data["total_testing_time"],
554
- 'executed_events': data["executed_events"],
555
- 'coverage_percent': round(data["coverage"], 2),
556
- 'total_activities_count': data["total_activities_count"],
557
- 'tested_activities_count': data["tested_activities_count"],
558
- 'tested_activities': data["tested_activities"],
559
- 'total_activities': data["total_activities"],
560
- 'all_properties_count': data["all_properties_count"],
561
- 'executed_properties_count': data["executed_properties_count"],
562
- 'items_per_page': 10, # Items to display per page
563
- 'screenshots': self.screenshots,
564
- 'property_violations': data["property_violations"],
565
- 'property_stats': data["property_stats"],
566
- 'property_error_details': data["property_error_details"],
567
- 'coverage_data': coverage_trend_json,
568
- 'take_screenshots': self.take_screenshots, # Pass screenshot setting to template
569
- 'property_execution_trend': data["property_execution_trend"],
570
- 'property_execution_data': json.dumps(data["property_execution_trend"]),
571
- 'activity_count_history': data["activity_count_history"],
572
- 'crash_events': data["crash_events"],
573
- 'anr_events': data["anr_events"]
574
- }
575
-
576
- # Check if template exists, if not create it
577
- template_path = Path(__file__).parent / "templates" / "bug_report_template.html"
578
- if not template_path.exists():
579
- logger.warning("Template file does not exist, creating default template...")
533
+ # Format timestamp for display
534
+ timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
535
+
536
+ # Ensure coverage_trend has data
537
+ if not data["coverage_trend"]:
538
+ logger.warning("No coverage trend data")
539
+ # Use the same field names as in coverage.log file
540
+ data["coverage_trend"] = [{"stepsCount": 0, "coverage": 0, "testedActivitiesCount": 0}]
541
+
542
+ # Convert coverage_trend to JSON string, ensuring all data points are included
543
+ coverage_trend_json = json.dumps(data["coverage_trend"])
544
+ logger.debug(f"Number of coverage trend data points: {len(data['coverage_trend'])}")
545
+
546
+ # Prepare template data
547
+ template_data = {
548
+ 'timestamp': timestamp,
549
+ 'bugs_found': data["bugs_found"],
550
+ 'total_testing_time': data["total_testing_time"],
551
+ 'executed_events': data["executed_events"],
552
+ 'coverage_percent': round(data["coverage"], 2),
553
+ 'total_activities_count': data["total_activities_count"],
554
+ 'tested_activities_count': data["tested_activities_count"],
555
+ 'tested_activities': data["tested_activities"],
556
+ 'total_activities': data["total_activities"],
557
+ 'all_properties_count': data["all_properties_count"],
558
+ 'executed_properties_count': data["executed_properties_count"],
559
+ 'items_per_page': 10, # Items to display per page
560
+ 'screenshots': self.screenshots,
561
+ 'property_violations': data["property_violations"],
562
+ 'property_stats': data["property_stats"],
563
+ 'property_error_details': data["property_error_details"],
564
+ 'coverage_data': coverage_trend_json,
565
+ 'take_screenshots': self.take_screenshots, # Pass screenshot setting to template
566
+ 'property_execution_trend': data["property_execution_trend"],
567
+ 'property_execution_data': json.dumps(data["property_execution_trend"]),
568
+ 'activity_count_history': data["activity_count_history"],
569
+ 'crash_events': data["crash_events"],
570
+ 'anr_events': data["anr_events"]
571
+ }
580
572
 
581
- # Use Jinja2 to render template
582
- template = self.jinja_env.get_template("bug_report_template.html")
583
- html_content = template.render(**template_data)
573
+ # Check if template exists, if not create it
574
+ template_path = Path(__file__).parent / "templates" / "bug_report_template.html"
575
+ if not template_path.exists():
576
+ logger.warning("Template file does not exist, creating default template...")
584
577
 
585
- return html_content
578
+ # Use Jinja2 to render template
579
+ template = self.jinja_env.get_template("bug_report_template.html")
580
+ html_content = template.render(**template_data)
586
581
 
587
- except Exception as e:
588
- logger.error(f"Error rendering template: {e}")
589
- raise
582
+ return html_content
590
583
 
591
584
  def _add_screenshot_info(self, step_data: StepData, step_index: int, data: Dict):
592
585
  """
@@ -697,9 +690,7 @@ class BugReportGenerator:
697
690
  data["property_violations"].append({
698
691
  "index": index,
699
692
  "property_name": property_name,
700
- "precondition_page": start_step,
701
- "interaction_pages": [start_step, end_step],
702
- "postcondition_page": end_step
693
+ "interaction_pages": [start_step, end_step]
703
694
  })
704
695
  index += 1
705
696
 
@@ -3,7 +3,7 @@ from retry.api import retry_call
3
3
  from dataclasses import asdict
4
4
  import requests
5
5
  from time import sleep
6
-
6
+ from pkg_resources import parse_version
7
7
 
8
8
  from uiautomator2.core import HTTPResponse, _http_request
9
9
  from kea2.adbUtils import ADBDevice, ADBStreamShell_V2
@@ -28,6 +28,7 @@ class FastbotManager:
28
28
  self._device_output_dir = None
29
29
  ADBDevice.setDevice(options.serial, options.transport_id)
30
30
  self.dev = ADBDevice()
31
+ self.android_release = parse_version(self.dev.getprop("ro.build.version.release"))
31
32
 
32
33
  def _activateFastbot(self) -> ADBStreamShell_V2:
33
34
  """
@@ -219,7 +220,7 @@ class FastbotManager:
219
220
  if self.thread.is_running():
220
221
  logger.info("Waiting for Fastbot to exit.")
221
222
  return self.thread.wait()
222
- return self.thread.poll()
223
+ return self.thread.poll() if self.android_release >= parse_version("7.0") else 0
223
224
 
224
225
  def start(self):
225
226
  # kill the fastbot process if runing.