Kea2-python 0.3.6__py3-none-any.whl → 1.0.1__py3-none-any.whl
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.
- kea2/__init__.py +1 -1
- kea2/assets/config_version.json +16 -0
- kea2/assets/fastbot_configs/teardown.py +18 -0
- kea2/assets/monkeyq.jar +0 -0
- kea2/assets/quicktest.py +21 -2
- kea2/bug_report_generator.py +116 -34
- kea2/cli.py +19 -9
- kea2/fastbotManager.py +20 -4
- kea2/keaUtils.py +360 -111
- kea2/kea_launcher.py +61 -23
- kea2/mixin.py +22 -0
- kea2/report_merger.py +107 -42
- kea2/resultSyncer.py +1 -1
- kea2/templates/bug_report_template.html +187 -19
- kea2/templates/merged_bug_report_template.html +3293 -3213
- kea2/u2Driver.py +18 -8
- kea2/utils.py +60 -14
- kea2/version_manager.py +101 -0
- {kea2_python-0.3.6.dist-info → kea2_python-1.0.1.dist-info}/METADATA +63 -15
- {kea2_python-0.3.6.dist-info → kea2_python-1.0.1.dist-info}/RECORD +24 -20
- {kea2_python-0.3.6.dist-info → kea2_python-1.0.1.dist-info}/WHEEL +0 -0
- {kea2_python-0.3.6.dist-info → kea2_python-1.0.1.dist-info}/entry_points.txt +0 -0
- {kea2_python-0.3.6.dist-info → kea2_python-1.0.1.dist-info}/licenses/LICENSE +0 -0
- {kea2_python-0.3.6.dist-info → kea2_python-1.0.1.dist-info}/top_level.txt +0 -0
kea2/u2Driver.py
CHANGED
|
@@ -8,7 +8,7 @@ import adbutils
|
|
|
8
8
|
import types
|
|
9
9
|
import rtree
|
|
10
10
|
import re
|
|
11
|
-
from typing import Any, Dict, List, Union, Optional
|
|
11
|
+
from typing import Any, Dict, List, Literal, Union, Optional
|
|
12
12
|
from http.client import HTTPResponse
|
|
13
13
|
from lxml import etree
|
|
14
14
|
from .absDriver import AbstractScriptDriver, AbstractStaticChecker, AbstractDriver
|
|
@@ -349,9 +349,11 @@ class _HindenWidgetFilter:
|
|
|
349
349
|
import traceback, uuid
|
|
350
350
|
traceback.print_exc()
|
|
351
351
|
logger.error(f"Error in setting covered widgets")
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
f.
|
|
352
|
+
from .utils import LoggingLevel
|
|
353
|
+
if LoggingLevel.level <= logging.DEBUG:
|
|
354
|
+
with open(f"kea2_error_tree_{uuid.uuid4().hex}.xml", "wb") as f:
|
|
355
|
+
xml_bytes = etree.tostring(root, pretty_print=True, encoding="utf-8", xml_declaration=True)
|
|
356
|
+
f.write(xml_bytes)
|
|
355
357
|
|
|
356
358
|
# xml_bytes = etree.tostring(root, pretty_print=True, encoding="utf-8", xml_declaration=True)
|
|
357
359
|
# with open("filtered_tree.xml", "wb") as f:
|
|
@@ -499,10 +501,18 @@ class U2Driver(AbstractDriver):
|
|
|
499
501
|
U2ScriptDriver.setTransportId(kwarg["transport_id"])
|
|
500
502
|
|
|
501
503
|
@classmethod
|
|
502
|
-
def getScriptDriver(
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
504
|
+
def getScriptDriver(cls, mode:Literal["direct", "proxy"]="proxy") -> u2.Device:
|
|
505
|
+
"""
|
|
506
|
+
get the uiautomator2 device instance
|
|
507
|
+
mode: direct or proxy
|
|
508
|
+
direct: connect to device directly (device server port: 9008)
|
|
509
|
+
proxy: connect to device via kea2 agent (device server port: 8090)
|
|
510
|
+
"""
|
|
511
|
+
if cls.scriptDriver is None:
|
|
512
|
+
cls.scriptDriver = U2ScriptDriver()
|
|
513
|
+
_instance = cls.scriptDriver.getInstance()
|
|
514
|
+
_instance._device_server_port = 9008 if mode == "direct" else 8090
|
|
515
|
+
return _instance
|
|
506
516
|
|
|
507
517
|
@classmethod
|
|
508
518
|
def getStaticChecker(self, hierarchy=None):
|
kea2/utils.py
CHANGED
|
@@ -2,12 +2,41 @@ import logging
|
|
|
2
2
|
import os
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
import traceback
|
|
5
|
-
from typing import
|
|
5
|
+
from typing import Callable, Dict, Optional
|
|
6
6
|
|
|
7
7
|
import time
|
|
8
8
|
from functools import wraps
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def singleton(cls):
|
|
13
|
+
_instance = {}
|
|
14
|
+
|
|
15
|
+
def inner():
|
|
16
|
+
if cls not in _instance:
|
|
17
|
+
_instance[cls] = cls()
|
|
18
|
+
return _instance[cls]
|
|
19
|
+
return inner
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class LoggingLevel:
|
|
24
|
+
level = logging.INFO
|
|
25
|
+
_instance: Optional["LoggingLevel"] = None # 单例缓存
|
|
26
|
+
|
|
27
|
+
def __new__(cls):
|
|
28
|
+
if cls._instance is None:
|
|
29
|
+
cls._instance = super().__new__(cls)
|
|
30
|
+
return cls._instance
|
|
31
|
+
|
|
32
|
+
@classmethod
|
|
33
|
+
def set_level(cls, level: int):
|
|
34
|
+
cls.level = level
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class DynamicLevelFilter(logging.Filter):
|
|
38
|
+
def filter(self, record: logging.LogRecord) -> bool:
|
|
39
|
+
return record.levelno >= LoggingLevel.level
|
|
11
40
|
|
|
12
41
|
|
|
13
42
|
def getLogger(name: str) -> logging.Logger:
|
|
@@ -17,10 +46,12 @@ def getLogger(name: str) -> logging.Logger:
|
|
|
17
46
|
if not logger.handlers:
|
|
18
47
|
# Configure handler
|
|
19
48
|
handler = logging.StreamHandler()
|
|
20
|
-
handler.flush = lambda: handler.stream.flush()
|
|
21
|
-
|
|
22
|
-
handler.
|
|
49
|
+
handler.flush = lambda: handler.stream.flush()
|
|
50
|
+
handler.setFormatter(logging.Formatter('[%(levelname)1s][%(asctime)s %(module)s:%(lineno)d pid:%(process)d] %(message)s'))
|
|
51
|
+
handler.setLevel(logging.NOTSET)
|
|
52
|
+
handler.addFilter(DynamicLevelFilter())
|
|
23
53
|
logger.addHandler(handler)
|
|
54
|
+
logger.setLevel(logging.DEBUG)
|
|
24
55
|
logger.propagate = False
|
|
25
56
|
|
|
26
57
|
enable_pretty_logging()
|
|
@@ -30,14 +61,7 @@ def getLogger(name: str) -> logging.Logger:
|
|
|
30
61
|
logger = getLogger(__name__)
|
|
31
62
|
|
|
32
63
|
|
|
33
|
-
def singleton(cls):
|
|
34
|
-
_instance = {}
|
|
35
64
|
|
|
36
|
-
def inner():
|
|
37
|
-
if cls not in _instance:
|
|
38
|
-
_instance[cls] = cls()
|
|
39
|
-
return _instance[cls]
|
|
40
|
-
return inner
|
|
41
65
|
|
|
42
66
|
@singleton
|
|
43
67
|
class TimeStamp:
|
|
@@ -109,4 +133,26 @@ def catchException(log_info: str):
|
|
|
109
133
|
tb = traceback.format_exception(type(e), e, e.__traceback__.tb_next)
|
|
110
134
|
print(''.join(tb), end='', flush=True)
|
|
111
135
|
return wrapper
|
|
112
|
-
return accept
|
|
136
|
+
return accept
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def loadFuncsFromFile(file_path: str) -> Dict[str, Callable]:
|
|
140
|
+
if not os.path.exists(file_path):
|
|
141
|
+
raise FileNotFoundError(f"{file_path} not found.")
|
|
142
|
+
|
|
143
|
+
def __get_module():
|
|
144
|
+
import importlib.util
|
|
145
|
+
module_name = Path(file_path).stem
|
|
146
|
+
spec = importlib.util.spec_from_file_location(module_name, file_path)
|
|
147
|
+
mod = importlib.util.module_from_spec(spec)
|
|
148
|
+
spec.loader.exec_module(mod)
|
|
149
|
+
return mod
|
|
150
|
+
|
|
151
|
+
mod = __get_module()
|
|
152
|
+
|
|
153
|
+
import inspect
|
|
154
|
+
funcs = dict()
|
|
155
|
+
for func_name, func in inspect.getmembers(mod, inspect.isfunction):
|
|
156
|
+
funcs[func_name] = func
|
|
157
|
+
|
|
158
|
+
return funcs
|
kea2/version_manager.py
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from packaging.version import Version
|
|
5
|
+
from .utils import getLogger, getProjectRoot
|
|
6
|
+
from typing import List, Set, TypedDict
|
|
7
|
+
import shutil
|
|
8
|
+
from importlib.metadata import version
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
logger = getLogger(__name__)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
CompatibilityInfo = TypedDict('CompatibilityInfo', {
|
|
15
|
+
"name": str,
|
|
16
|
+
"description": str,
|
|
17
|
+
"from": str,
|
|
18
|
+
"to": str,
|
|
19
|
+
})
|
|
20
|
+
VersionInfo = TypedDict('VersionInfo', {
|
|
21
|
+
"compatibility infos": List[CompatibilityInfo],
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def ls_files(dir_path: Path) -> Set[Path]:
|
|
26
|
+
"""list all files in the directory"""
|
|
27
|
+
return set(f for f in dir_path.rglob('*') if f.is_file())
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def check_config_compatibility():
|
|
31
|
+
config_version_sanitizer = ConfigVersionSanitizer()
|
|
32
|
+
config_version_sanitizer.check_config_compatibility()
|
|
33
|
+
config_version_sanitizer.config_auto_update()
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def get_cur_version():
|
|
37
|
+
return version("Kea2-python")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class ConfigVersionSanitizer:
|
|
41
|
+
def __init__(self):
|
|
42
|
+
self._version_infos = None
|
|
43
|
+
self._config_version = None
|
|
44
|
+
self.user_config_path = getProjectRoot() / "configs"
|
|
45
|
+
self.kea2_assets_path = Path(__file__).parent / "assets"
|
|
46
|
+
self.kea2_version = get_cur_version()
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def version_infos(self) -> VersionInfo:
|
|
50
|
+
if self._version_infos is None:
|
|
51
|
+
with open(self.kea2_assets_path / "config_version.json") as fp:
|
|
52
|
+
self._version_infos = json.load(fp)
|
|
53
|
+
return self._version_infos
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def config_version(self):
|
|
57
|
+
if self._config_version is not None:
|
|
58
|
+
return self._config_version
|
|
59
|
+
|
|
60
|
+
user_version_json = self.user_config_path / "version.json"
|
|
61
|
+
if not user_version_json.exists():
|
|
62
|
+
self._config_version = "0.3.6"
|
|
63
|
+
else:
|
|
64
|
+
with open(user_version_json) as fp:
|
|
65
|
+
self._config_version = json.load(fp)["version"]
|
|
66
|
+
return self._config_version
|
|
67
|
+
|
|
68
|
+
def check_config_compatibility(self):
|
|
69
|
+
"""Check if the user config version is compatible with the current Kea2 version."""
|
|
70
|
+
update_infos = []
|
|
71
|
+
for info in self.version_infos["compatibility infos"]:
|
|
72
|
+
if Version(info["from"]) > Version(self.config_version):
|
|
73
|
+
update_infos.append(info)
|
|
74
|
+
|
|
75
|
+
if not update_infos:
|
|
76
|
+
return
|
|
77
|
+
|
|
78
|
+
logger.warning("Configuration update required! Please update your configuration files.")
|
|
79
|
+
logger.warning(f"Current kea2 version {self.kea2_version}. Current config version {self.config_version}.")
|
|
80
|
+
for info in update_infos:
|
|
81
|
+
logger.info(
|
|
82
|
+
f"Since version {info['from']}: {info['description']}"
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
def config_auto_update(self):
|
|
86
|
+
self._copy_new_configs()
|
|
87
|
+
|
|
88
|
+
def _copy_new_configs(self):
|
|
89
|
+
src = self.kea2_assets_path / "fastbot_configs"
|
|
90
|
+
dst = self.user_config_path
|
|
91
|
+
|
|
92
|
+
src_files = set(os.listdir(src))
|
|
93
|
+
dst_files = set(os.listdir(dst))
|
|
94
|
+
|
|
95
|
+
new_files = src_files - dst_files
|
|
96
|
+
|
|
97
|
+
for file in new_files:
|
|
98
|
+
src_path = src / file
|
|
99
|
+
dst_path = dst / file
|
|
100
|
+
logger.info(f"Copying new config file: {file}")
|
|
101
|
+
shutil.copy2(src_path, dst_path)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Kea2-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.1
|
|
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
|
|
@@ -64,11 +64,11 @@ Kea2 currently targets [Android](https://en.wikipedia.org/wiki/Android_(operatin
|
|
|
64
64
|
|
|
65
65
|
**The ability of the three features in Kea2**
|
|
66
66
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
| **Finding crashes**
|
|
70
|
-
| **Finding crashes in deep states**
|
|
71
|
-
| **Finding non-crashing functional (logic) bugs** |
|
|
67
|
+
| | **Feature 1** | **Feature 2** | **Feature 3** |
|
|
68
|
+
| ------------------------------------------------ | ------------- | ------------- | ------------- |
|
|
69
|
+
| **Finding crashes** | :+1: | :+1: | :+1: |
|
|
70
|
+
| **Finding crashes in deep states** | | :+1: | :+1: |
|
|
71
|
+
| **Finding non-crashing functional (logic) bugs** | | | :+1: |
|
|
72
72
|
|
|
73
73
|
## Kea2's Users
|
|
74
74
|
|
|
@@ -78,6 +78,10 @@ Kea2 (and its idea) has been used/integrated by
|
|
|
78
78
|
|
|
79
79
|
- [WeChat's iExplorer]() --- WeChat's in-house testing platform
|
|
80
80
|
|
|
81
|
+
- [WeChat Payment's UAT]() --- WeChat Payment's in-house testing platform
|
|
82
|
+
|
|
83
|
+
- [DevEco Testing](https://developer.huawei.com/consumer/cn/deveco-testing/) --- Huawei's Official Testing Platform for HarmonyOS
|
|
84
|
+
|
|
81
85
|
- [ByteDance's Fastbot](https://github.com/bytedance/Fastbot_Android)
|
|
82
86
|
|
|
83
87
|
Please let us know and willing to hear your feedback/questions if you are also using Kea2.
|
|
@@ -115,6 +119,15 @@ Upgrade Kea2 to its latest version if you already installed Kea2 before:
|
|
|
115
119
|
```bash
|
|
116
120
|
python3 -m pip install -U kea2-python
|
|
117
121
|
```
|
|
122
|
+
> If you're using mirror sites like Tsinghua or USTC, you may fail to upgrade. Because these sites may not have the latest version yet. In this case, you can try to install Kea2 by specifying the latest version manually, or use `pypi.org` directly by `pip install kea2-python -i https://pypi.org/simple`.
|
|
123
|
+
|
|
124
|
+
Upgrade Kea2 to the specifc latest version (e.g., 0.3.6) if you already installed Kea2 before:
|
|
125
|
+
```bash
|
|
126
|
+
python3 -m pip install -U kea2-python==0.3.6
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
118
131
|
|
|
119
132
|
## Quick Test
|
|
120
133
|
|
|
@@ -145,9 +158,8 @@ Otherwise, please help [file a bug report](https://github.com/ecnusse/Kea2/issue
|
|
|
145
158
|
|
|
146
159
|
Test your app with the full capability of Fastbot for stress testing and finding *stability problems* (i.e., *crashing bugs*);
|
|
147
160
|
|
|
148
|
-
|
|
149
161
|
```bash
|
|
150
|
-
kea2 run -
|
|
162
|
+
kea2 run -p it.feio.android.omninotes.alpha --running-minutes 10 --throttle 200
|
|
151
163
|
```
|
|
152
164
|
|
|
153
165
|
To understand the meanings of the options, you can see our [manual](docs/manual_en.md#launching-kea2).
|
|
@@ -196,7 +208,7 @@ You can find the full example in script `quicktest.py`, and run this script with
|
|
|
196
208
|
|
|
197
209
|
```bash
|
|
198
210
|
# Launch Kea2 and load one single script quicktest.py.
|
|
199
|
-
kea2 run -
|
|
211
|
+
kea2 run -p it.feio.android.omninotes.alpha --agent u2 --running-minutes 10 --throttle 200 --driver-name d propertytest discover -p quicktest.py
|
|
200
212
|
```
|
|
201
213
|
|
|
202
214
|
## Feature 3(运行增强版Fastbot:加入自动断言)
|
|
@@ -220,7 +232,7 @@ In a social media app, message sending is a common feature. On the message sendi
|
|
|
220
232
|
<div align="center">
|
|
221
233
|
The expected behavior (the upper figure) and the buggy behavior (the lower figure).
|
|
222
234
|
</div>
|
|
223
|
-
|
|
235
|
+
|
|
224
236
|
|
|
225
237
|
For the preceding always-holding property, we can write the following script to validate the functional correctness: when there is an `input_box` widget on the message sending page, we can type any non-empty string text into the input box and assert `send_button` should always exists.
|
|
226
238
|
|
|
@@ -243,9 +255,37 @@ For the preceding always-holding property, we can write the following script to
|
|
|
243
255
|
|
|
244
256
|
You can run this example by using the similar command line in Feature 2.
|
|
245
257
|
|
|
258
|
+
## Feature 4 (Experimental feature, 实验中,脚本与遍历的混合测试)
|
|
259
|
+
|
|
260
|
+
> This feature is still under development. We are looking forward to your feedback! Contact us if you're interested in this feature.
|
|
261
|
+
|
|
262
|
+
Kea2 supports reusing existing Ui test Scripts. We are inspired by the idea that: *The existing Ui test scripts usually cover important app functionalities and can reach deep app states. Thus, they can be used as good "guiding scripts" to drive Fastbot to explore important and deep app states.*
|
|
263
|
+
|
|
264
|
+
For example, you may already have some existing Ui test scripts "login and add a friend", This feature allows you to use the existing script, set some breakpoints (i.e., interruptable points) in the script, and launch Fastbot to explore the app after every breakpoint. By using this feature, you can do the login first and then launch Fastbot to explore the app after login. Which helps Fastbot to explore deep app states. (fastbot can't do login by itself easily).
|
|
265
|
+
|
|
266
|
+
### Example
|
|
267
|
+
|
|
268
|
+
See [guide_scripts.py](guide_scripts.py) for a full example.
|
|
269
|
+
|
|
270
|
+
By the decorator `@interruptable`, you can mark the testcase as "interruptable" so that Kea2 can recognize this script and launch fuzzing test after it returns.
|
|
271
|
+
|
|
272
|
+
Since the state of app is probably unpredicted after fuzzing tests, Kea2 provides a `common_teardown` function to clean up the environment between previous script and next script. The function can be manually specified in `configs/teardown.py`.
|
|
273
|
+
|
|
274
|
+
You can find the full example in `guide_scripts.py`, `property_omninotes.py` and `configs/teardown.py` . You can run one of the following commands:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
# Guide with guide_scripts.py and launch fuzzing test after every script.
|
|
278
|
+
kea2 run -p it.feio.android.omninotes.alpha --agent u2 --running-minutes 10 --throttle 500 --max-step 15 --driver-name d unittest discover -p guide_scripts.py
|
|
279
|
+
|
|
280
|
+
# Guide with guide_scripts.py and launch fuzzing test after every script(check properties during fuzzing).
|
|
281
|
+
kea2 run -p it.feio.android.omninotes.alpha --agent u2 --running-minutes 10 --throttle 500 --max-step 15 --driver-name d unittest discover -p guide_scripts.py propertytest discover -p quickstart2.py
|
|
282
|
+
```
|
|
283
|
+
|
|
246
284
|
## Test Reports(测试报告)
|
|
247
285
|
|
|
248
|
-
Kea2 automatically generates comprehensive HTML test reports after each testing session.
|
|
286
|
+
Kea2 automatically generates comprehensive HTML test reports after each testing session.(The location is in the output/ directory)
|
|
287
|
+
|
|
288
|
+
If automatic generation fails, you can also manually generate the test report using the command "kea2 report -p 'the path to the folder containing the test data'"
|
|
249
289
|
|
|
250
290
|
The reports support both single test runs and merged analysis of multiple test sessions, making it easy to track testing progress and identify issues.
|
|
251
291
|
|
|
@@ -253,12 +293,16 @@ The reports support both single test runs and merged analysis of multiple test s
|
|
|
253
293
|
|
|
254
294
|
## Documentations(更多文档)
|
|
255
295
|
|
|
296
|
+
|
|
297
|
+
### :blue_book: [User Manual](docs/manual_en.md) (Important!)
|
|
256
298
|
You can find the [user manual](docs/manual_en.md), which includes:
|
|
257
299
|
- Examples of using Kea2 on WeChat (in Chinese);
|
|
258
300
|
- How to define Kea2's scripts and use the decorators (e.g., `@precondition`、`@prob`、`@max_tries`);
|
|
259
301
|
- How to run Kea2 and Kea2's command line options
|
|
260
302
|
- How to find and understand Kea2's testing results
|
|
261
303
|
- How to [whitelist or blacklist](docs/blacklisting.md) specific activities, UI widgets and UI regions during fuzzing
|
|
304
|
+
|
|
305
|
+
### Other resources about Kea2 (in Chinese)
|
|
262
306
|
- [Q&A for Kea2 and PBT (对Kea2和PBT技术的常见问题和回答)](https://sy8pzmhmun.feishu.cn/wiki/SLGwwqgzIiEuC3kwmV8cSZY0nTg?from=from_copylink)
|
|
263
307
|
- [Kea2 101 (Kea2 从0到1 的入门教程与最佳实践,建议新手阅读)](https://sy8pzmhmun.feishu.cn/wiki/EwaWwPCitiUJoBkIgALcHtglnDK?from=from_copylink)
|
|
264
308
|
- [Kea2 分享交流会 (2025.09, bilibili 录播)](https://www.bilibili.com/video/BV1CZYNz9Ei5/?vd_source=ab7968b8d764666d85d24af49d9b8891)
|
|
@@ -276,13 +320,13 @@ Some blogs on Kea/Kea2 (in Chinese):
|
|
|
276
320
|
<summary>Kea2的性质是什么含义?Kea2意义和价值是什么?</summary>
|
|
277
321
|
|
|
278
322
|
kea2 其实是一个工具,它是python+u2+fastbot的集合体。 它本身更像是一台装好了发动机和轮子的汽车底盘。
|
|
279
|
-
|
|
323
|
+
|
|
280
324
|
性质是苏老师他们团队提出的一个概念, 转换到测试领域的实际工作中,性质对应的是最小单位的功能(原子级功能),性质的依赖条件很少或没有,它可以自身运行。一个典型的性质就是登录,它仅仅具有输入用户名,输入密码,提交。再举个例子,给视频点个赞,也就是简单的两三步。就是一个性质。
|
|
281
|
-
|
|
325
|
+
|
|
282
326
|
性质与kea2结合的意义是在于解决过去使用appium过重的问题。用appium去测试一个性质通常要写很多行的代码,引导界面到达性质的位置。但使用kea2,就只需要编写性质,如何到其所在的位置是交给fastbot和它的学习算法来搞定的。
|
|
283
|
-
|
|
327
|
+
|
|
284
328
|
kea2另个重大的价值是,它解决了上述思想所需要的技术支撑,比appium更轻量的UI编写方式,fastbot编写性质的能力不足,以及无法编写逻辑和断言。整体上是保留了fastbot以往的优秀品质,完善了其不足和短板。
|
|
285
|
-
|
|
329
|
+
|
|
286
330
|
简而言之,需要做传统的编排型的功能测试,仍然使用appium,使用kea2也行,但你感觉不到它的价值。本身有需要做混沌测试,模糊测试,兼容性测试。那么强烈,强烈推荐kea2。kea2更偏探索性测试而非编排型。
|
|
287
331
|
</details>
|
|
288
332
|
|
|
@@ -345,6 +389,10 @@ Kea2 has been actively developed and maintained by the people in [ecnusse](https
|
|
|
345
389
|
|
|
346
390
|
Kea2 has also received many valuable insights, advices, feedbacks and lessons shared by several industrial people from Bytedance ([Zhao Zhang](https://github.com/zhangzhao4444), Yuhui Su from the Fastbot team), OPay (Tiesong Liu), WeChat (Haochuan Lu, Yuetang Deng), Huawei, Xiaomi and etc. Kudos!
|
|
347
391
|
|
|
392
|
+
### Star History
|
|
393
|
+
|
|
394
|
+
[](https://www.star-history.com/#ecnusse/Kea2&Date)
|
|
395
|
+
|
|
348
396
|
[^1]: 不少UI自动化测试工具提供了“自定义事件序列”能力(如[Fastbot](https://github.com/bytedance/Fastbot_Android/blob/main/handbook-cn.md#%E8%87%AA%E5%AE%9A%E4%B9%89%E4%BA%8B%E4%BB%B6%E5%BA%8F%E5%88%97) 和[AppCrawler](https://github.com/seveniruby/AppCrawler)),但在实际使用中存在不少问题,如自定义能力有限、使用不灵活等。此前不少Fastbot用户抱怨过其“自定义事件序列”在使用中的问题,如[#209](https://github.com/bytedance/Fastbot_Android/issues/209), [#225](https://github.com/bytedance/Fastbot_Android/issues/225), [#286](https://github.com/bytedance/Fastbot_Android/issues/286)等。
|
|
349
397
|
|
|
350
398
|
[^2]: 在UI自动化测试过程中支持自动断言是一个很重要的能力,但几乎没有测试工具提供这样的能力。我们注意到[AppCrawler](https://ceshiren.com/t/topic/15801/5)的开发者曾经希望提供一种断言机制,得到了用户的热切响应,不少用户从21年就开始催更,但始终未能实现。
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
kea2/__init__.py,sha256=
|
|
1
|
+
kea2/__init__.py,sha256=Vqf9XZkOau0Kz59tI4OJRRIOG1AnL45ZUuPrri99gFg,123
|
|
2
2
|
kea2/absDriver.py,sha256=NzmsLs1Ojz-yEXctGAqj7aKBwAQW19zd83l65RABCe8,1288
|
|
3
3
|
kea2/adbUtils.py,sha256=zi0T0_g44xZQZe3XYzBsuh7VTHpdZ4dd6yKi-p7BTYI,19939
|
|
4
|
-
kea2/bug_report_generator.py,sha256=
|
|
5
|
-
kea2/cli.py,sha256=
|
|
6
|
-
kea2/fastbotManager.py,sha256=
|
|
7
|
-
kea2/keaUtils.py,sha256=
|
|
8
|
-
kea2/kea_launcher.py,sha256=
|
|
4
|
+
kea2/bug_report_generator.py,sha256=0j8Wexb2Vkf558G1a94vb7Wh_vfx-P4B_TEXKOBIev8,47798
|
|
5
|
+
kea2/cli.py,sha256=yyHchKf3lro-BuHD9Gen431gaUPvL2stt6ZKWGpVbqI,6825
|
|
6
|
+
kea2/fastbotManager.py,sha256=t4R5Px-zciAnFe97TVhrnj3qCwvMMycISmfSSckGe7Y,8874
|
|
7
|
+
kea2/keaUtils.py,sha256=IzSmoJD-z6M_Bdfo10rQ2XS7HJ1hibVzkyM3eUNheRg,35799
|
|
8
|
+
kea2/kea_launcher.py,sha256=gKP7BnE8lQfypPrRCU3TSLIUg19u_v6Abt9JCTw9S-A,8126
|
|
9
9
|
kea2/logWatcher.py,sha256=Dp6OzvLSuWYw0AqdcPDqfotaRZQgpF8S49LInGsAWp8,2599
|
|
10
|
-
kea2/
|
|
11
|
-
kea2/
|
|
12
|
-
kea2/
|
|
13
|
-
kea2/
|
|
10
|
+
kea2/mixin.py,sha256=2Z9c7BfI6Z-K970sK8FFzKeld0bFPDQWhmh9uuDy4BI,819
|
|
11
|
+
kea2/report_merger.py,sha256=TFxXeA_y0OL7aMzBpiykfm270dpJrIyl9LsJft8w0SM,27781
|
|
12
|
+
kea2/resultSyncer.py,sha256=0xpcLYKmLYrIslWAQi-bZG_Vji3AhqvYbUm-gxPvsvo,2431
|
|
13
|
+
kea2/u2Driver.py,sha256=dk0XHgOKWUT7Uaxd1TdjJ6MnM-3DVgWcBu6DcuElXVo,20698
|
|
14
|
+
kea2/utils.py,sha256=qBE8gIRV3QqXn86pyXzEoFIlmonYp4PCIkqRnZGOSqU,4426
|
|
15
|
+
kea2/version_manager.py,sha256=XN43wvIuJLigZ1mg1jGbBCEUTNHvAkBhDOlAZZk3RDU,3195
|
|
16
|
+
kea2/assets/config_version.json,sha256=dYZRNo17hQq2SV45xxRCwDmykhsWWYI__w7vZXMHvXc,377
|
|
14
17
|
kea2/assets/fastbot-thirdpart.jar,sha256=0SZ_OoZFWDGMnazgXKceHgKvXdUDoIa3Gb2bcifaikk,85664
|
|
15
18
|
kea2/assets/framework.jar,sha256=rTluOJJKj2DFwh7ascXso1udYdWv00BxBwSQ3Vmv-fw,1149240
|
|
16
19
|
kea2/assets/kea2-thirdpart.jar,sha256=HYdtG2gqDLuLb72dpK3lX-Y6QUNTrJ-bfQopU5aWpfo,359346
|
|
17
|
-
kea2/assets/monkeyq.jar,sha256=
|
|
18
|
-
kea2/assets/quicktest.py,sha256=
|
|
20
|
+
kea2/assets/monkeyq.jar,sha256=3IYwE6Htf8ET5KBy7VR9iGVxs8Djs3FB_vcMExBpLT4,114326
|
|
21
|
+
kea2/assets/quicktest.py,sha256=8lv_J5cVF6UdAnBM4bEmf9H_d1eicByJ-Jl9Cmi6rEE,3519
|
|
19
22
|
kea2/assets/fastbot_configs/abl.strings,sha256=Rn8_YEbVGOJqndIY_-kWnR5NaoFI-cuB-ij10Ddhl90,75
|
|
20
23
|
kea2/assets/fastbot_configs/awl.strings,sha256=-j4980GoWQxGOM9ijAwXPQmziCwFBZJFmuiv2tOEaYI,101
|
|
21
24
|
kea2/assets/fastbot_configs/max.config,sha256=rBgR4mdgBzqVPQ2lZaXqx2WN6tDzhe-FNizm4Y7tyA8,226
|
|
@@ -23,16 +26,17 @@ kea2/assets/fastbot_configs/max.fuzzing.strings,sha256=_3bNHwgzlISgxB7RmMury5X3q
|
|
|
23
26
|
kea2/assets/fastbot_configs/max.schema.strings,sha256=zYupzvmTtnbPYomI2UCPk0s6PE97t94myZU_j3HutRM,40
|
|
24
27
|
kea2/assets/fastbot_configs/max.strings,sha256=k82GAAZZG7KbDI7bk7DUklp41WJJO7j-j8Ss1BcybUw,32
|
|
25
28
|
kea2/assets/fastbot_configs/max.tree.pruning,sha256=dm0oesN75FFbVSkV7STDUmrNMpQUBEuO7Uymt6nEkBc,629
|
|
29
|
+
kea2/assets/fastbot_configs/teardown.py,sha256=dW6xHzozh2vXTB1qfCxAlT0xcv5kFwzX7kW1FmLfNA0,363
|
|
26
30
|
kea2/assets/fastbot_configs/widget.block.py,sha256=r9Njm2xSBls3GMDIHTPMdmlFRiOjJWuVsq2KiieWFXA,1272
|
|
27
31
|
kea2/assets/fastbot_libs/arm64-v8a/libfastbot_native.so,sha256=tAFrG73pJi7XakRxSp9CavPHbexKvhC9NOMdt48IEuM,2006872
|
|
28
32
|
kea2/assets/fastbot_libs/armeabi-v7a/libfastbot_native.so,sha256=UV8bhaiPoPKdd3q0vj3kSZqPR9anllai_tz_2QkMMbQ,1335372
|
|
29
33
|
kea2/assets/fastbot_libs/x86/libfastbot_native.so,sha256=k-aw1gEXRWMKZRNHIggKNuZy0wC1y2BnveJGEIO6rbo,2036856
|
|
30
34
|
kea2/assets/fastbot_libs/x86_64/libfastbot_native.so,sha256=tiofhlf4uMQcU5WAvrdLgTBME0lb83hVUoGtTwxmE8A,2121416
|
|
31
|
-
kea2/templates/bug_report_template.html,sha256=
|
|
32
|
-
kea2/templates/merged_bug_report_template.html,sha256=
|
|
33
|
-
kea2_python-0.
|
|
34
|
-
kea2_python-0.
|
|
35
|
-
kea2_python-0.
|
|
36
|
-
kea2_python-0.
|
|
37
|
-
kea2_python-0.
|
|
38
|
-
kea2_python-0.
|
|
35
|
+
kea2/templates/bug_report_template.html,sha256=I00MZQwDimdYzWOvB3e_BqxRTtcNlsmSgn4IHmkGtEM,160727
|
|
36
|
+
kea2/templates/merged_bug_report_template.html,sha256=0cIKCk3Zi8Tmb8x7LjO28vzK-sDUgUgtaBppRndwTgE,147509
|
|
37
|
+
kea2_python-1.0.1.dist-info/licenses/LICENSE,sha256=nM9PPjcsXVo5SzNsjRqWgA-gdJlwqZZcRDSC6Qf6bVE,2034
|
|
38
|
+
kea2_python-1.0.1.dist-info/METADATA,sha256=sJSRIJ8Mzfblw50mT9hPJ5u1OAgd1o9-vMQg5D1FRLQ,22832
|
|
39
|
+
kea2_python-1.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
40
|
+
kea2_python-1.0.1.dist-info/entry_points.txt,sha256=mFX06TyxXiUAJQ6JZn8QHzfn8n5R8_KJ5W-pTm_fRCA,39
|
|
41
|
+
kea2_python-1.0.1.dist-info/top_level.txt,sha256=TsgNH4PQoNOVhegpO7AcjutMVWp6Z4KDL1pBH9FnMmk,5
|
|
42
|
+
kea2_python-1.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|