Kea2-python 0.0.1a3__py3-none-any.whl → 0.0.1a4__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/cli.py +2 -2
- kea2/keaUtils.py +11 -0
- kea2/kea_launcher.py +14 -2
- {kea2_python-0.0.1a3.dist-info → kea2_python-0.0.1a4.dist-info}/METADATA +9 -10
- {kea2_python-0.0.1a3.dist-info → kea2_python-0.0.1a4.dist-info}/RECORD +9 -9
- {kea2_python-0.0.1a3.dist-info → kea2_python-0.0.1a4.dist-info}/WHEEL +0 -0
- {kea2_python-0.0.1a3.dist-info → kea2_python-0.0.1a4.dist-info}/entry_points.txt +0 -0
- {kea2_python-0.0.1a3.dist-info → kea2_python-0.0.1a4.dist-info}/licenses/LICENSE +0 -0
- {kea2_python-0.0.1a3.dist-info → kea2_python-0.0.1a4.dist-info}/top_level.txt +0 -0
kea2/cli.py
CHANGED
|
@@ -156,8 +156,8 @@ def main():
|
|
|
156
156
|
kwargs.pop('args', None)
|
|
157
157
|
sp.add_argument(*args, **kwargs)
|
|
158
158
|
|
|
159
|
-
from .kea_launcher import
|
|
160
|
-
|
|
159
|
+
from .kea_launcher import _set_runner_parser
|
|
160
|
+
_set_runner_parser(subparser)
|
|
161
161
|
actions["run"] = cmd_run
|
|
162
162
|
if sys.argv[1:] == ["run"]:
|
|
163
163
|
sys.argv.append("-h")
|
kea2/keaUtils.py
CHANGED
|
@@ -94,6 +94,8 @@ class Options:
|
|
|
94
94
|
running_mins: int = 10
|
|
95
95
|
# time(ms) to wait when exploring the app
|
|
96
96
|
throttle: int = 200
|
|
97
|
+
# the output_dir for saving logs and results
|
|
98
|
+
output_dir: str = "output"
|
|
97
99
|
|
|
98
100
|
|
|
99
101
|
@dataclass
|
|
@@ -261,6 +263,13 @@ class KeaTestRunner(TextTestRunner):
|
|
|
261
263
|
options.Driver = None
|
|
262
264
|
cls.options = options
|
|
263
265
|
|
|
266
|
+
def _setOuputDir(self):
|
|
267
|
+
output_dir = Path(self.options.output_dir).absolute()
|
|
268
|
+
os.mkdir(output_dir, parents=True, exist_ok=True)
|
|
269
|
+
global LOGFILE, RESFILE
|
|
270
|
+
LOGFILE = output_dir / Path(LOGFILE)
|
|
271
|
+
RESFILE = output_dir / Path(RESFILE)
|
|
272
|
+
|
|
264
273
|
def run(self, test):
|
|
265
274
|
|
|
266
275
|
self.allProperties = dict()
|
|
@@ -269,6 +278,8 @@ class KeaTestRunner(TextTestRunner):
|
|
|
269
278
|
if len(self.allProperties) == 0:
|
|
270
279
|
print("[Warning] No property has been found.", flush=True)
|
|
271
280
|
|
|
281
|
+
self._setOuputDir()
|
|
282
|
+
|
|
272
283
|
JsonResult.setProperties(self.allProperties)
|
|
273
284
|
self.resultclass = JsonResult
|
|
274
285
|
|
kea2/kea_launcher.py
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import os
|
|
1
2
|
import sys
|
|
2
3
|
import argparse
|
|
3
4
|
import unittest
|
|
5
|
+
from pathlib import Path
|
|
4
6
|
from typing import List
|
|
5
7
|
|
|
6
|
-
def
|
|
8
|
+
def _set_runner_parser(subparsers: "argparse._SubParsersAction[argparse.ArgumentParser]"):
|
|
7
9
|
parser = subparsers.add_parser("run", help="run kea2")
|
|
8
10
|
parser.add_argument(
|
|
9
11
|
"-s",
|
|
@@ -23,6 +25,16 @@ def _set_driver_parser(subparsers: "argparse._SubParsersAction[argparse.Argument
|
|
|
23
25
|
help="The target package names com.example.app",
|
|
24
26
|
)
|
|
25
27
|
|
|
28
|
+
parser.add_argument(
|
|
29
|
+
"-o",
|
|
30
|
+
"--output-dir",
|
|
31
|
+
dest="output_dir",
|
|
32
|
+
type=str,
|
|
33
|
+
required=False,
|
|
34
|
+
default="output",
|
|
35
|
+
help="The output dir for saving logs and results."
|
|
36
|
+
)
|
|
37
|
+
|
|
26
38
|
parser.add_argument(
|
|
27
39
|
"--agent",
|
|
28
40
|
dest="agent",
|
|
@@ -96,7 +108,7 @@ def parse_args(argv: List):
|
|
|
96
108
|
parser = argparse.ArgumentParser(description="Kea2")
|
|
97
109
|
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
98
110
|
|
|
99
|
-
|
|
111
|
+
_set_runner_parser(subparsers)
|
|
100
112
|
args = parser.parse_args(argv)
|
|
101
113
|
return args
|
|
102
114
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Kea2-python
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.1a4
|
|
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
|
-
Requires-Python: >=3.
|
|
6
|
+
Requires-Python: >=3.8
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-File: LICENSE
|
|
9
|
-
Requires-Dist: rtree>=1.
|
|
9
|
+
Requires-Dist: rtree>=1.3.0
|
|
10
10
|
Requires-Dist: uiautomator2>=3.2.9
|
|
11
11
|
Dynamic: license-file
|
|
12
12
|
|
|
13
13
|
# Introduction
|
|
14
14
|
|
|
15
|
-
Kea2 is an easy-to-use Python library for supporting and
|
|
15
|
+
Kea2 is an easy-to-use Python library for supporting, customizing and improving automated UI testing for mobile apps. The library is currently built on top of [Fastbot](https://github.com/bytedance/Fastbot_Android) and [uiautomator2](https://github.com/openatx/uiautomator2), and targeting [Android](https://en.wikipedia.org/wiki/Android_(operating_system)) apps.
|
|
16
16
|
|
|
17
17
|
### Kea2 has three important features:
|
|
18
18
|
- **Feature 1**(查找稳定性问题): coming with the full capability of [Fastbot](https://github.com/bytedance/Fastbot_Android) for stress testing and finding *stability problems* (i.e., *crashing bugs*);
|
|
@@ -52,7 +52,7 @@ In the future, Kea2 will be extended to support
|
|
|
52
52
|
|
|
53
53
|
Running requirements/environment:
|
|
54
54
|
- support Windows, MacOS and Linux
|
|
55
|
-
- python 3.
|
|
55
|
+
- python 3.8+
|
|
56
56
|
- Android SDK installed
|
|
57
57
|
- **VPN closed** (Features 2 and 3 required)
|
|
58
58
|
|
|
@@ -99,7 +99,7 @@ kea2 run -s "emulator-5554" -p it.feio.android.omninotes.alpha --agent native --
|
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
The usage is similar to the the original [Fastbot](https://github.com/bytedance/Fastbot_Android?tab=readme-ov-file#run-fastbot-with-shell-command)'s shell commands.
|
|
102
|
-
See more options by `
|
|
102
|
+
See more options by `kea2 run -h`
|
|
103
103
|
|
|
104
104
|
|
|
105
105
|
## Feature 2(自定义测试场景或事件序列): customizing testing scenarios by scripts
|
|
@@ -153,14 +153,13 @@ You can find the full example in script `quickstart.py` and run it by executing:
|
|
|
153
153
|
python3 quickstart.py u2
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
+
In real use, you can use `kea2 run` to launch the customizing script.
|
|
157
|
+
|
|
156
158
|
```bash
|
|
157
159
|
# Launch Kea2 and load one single script quickstart.py.
|
|
158
|
-
kea2 run -s "emulator-5554" -p it.feio.android.omninotes.alpha --agent u2 --running-minutes 10 --throttle 200 --driver-name d unittest quickstart.py
|
|
160
|
+
kea2 run -s "emulator-5554" -p it.feio.android.omninotes.alpha --agent u2 --running-minutes 10 --throttle 200 --driver-name d unittest discover -p quickstart.py
|
|
159
161
|
```
|
|
160
162
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
163
|
## Feature 3(支持断言机制): Supporting auto-assertions by scripts.
|
|
165
164
|
|
|
166
165
|
Kea2 supports auto-assertions when running Fastbot for finding *logic bugs* (i.e., *non-crashing bugs*). To achieve this, you can add assertions in the scripts. When an assertion fails during automated UI testing, we find a likely functional bug. This idea is inspired by [property-based testing](https://en.wikipedia.org/wiki/Software_testing#Property_testing) inheritted from [Kea](https://github.com/ecnusse/Kea).
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
kea2/__init__.py,sha256=_IFDiyzb6OLyhjldBXrAol6OpOijTnJ2LYWMK4TqSno,121
|
|
2
2
|
kea2/absDriver.py,sha256=M08ba0kpIer20ApMhX7yCmcLrfPb6a3udZxR_4FhriI,1224
|
|
3
3
|
kea2/adbUtils.py,sha256=IV-5G_3mc89YP1NJZJIWUrgxb13QECGGXTTANkGH_Rk,8986
|
|
4
|
-
kea2/cli.py,sha256=
|
|
5
|
-
kea2/keaUtils.py,sha256=
|
|
6
|
-
kea2/kea_launcher.py,sha256=
|
|
4
|
+
kea2/cli.py,sha256=V_TOe-weqc-LvYmf3hGnm5W3_-aa1_swo3rKhOEib4o,4349
|
|
5
|
+
kea2/keaUtils.py,sha256=6ZQIrjhH6rBi9mFUO3qJqRJD42i39nkqlq7D-Z4b5vQ,20126
|
|
6
|
+
kea2/kea_launcher.py,sha256=m58wi1_L4TrvSjIhkYDNVHljBixXoRe7oUvu59rjBtM,4175
|
|
7
7
|
kea2/logWatcher.py,sha256=hd8banPiCa6aCQ6d_MznWKOdzK_A2X_dPbrx-usjxgE,1927
|
|
8
8
|
kea2/u2Driver.py,sha256=NE7Q6OUB9DtoLueZO7ruZoRE3Wp0dp_-R4QHRDLaBvE,10507
|
|
9
9
|
kea2/utils.py,sha256=zjuoVwts2qVX9GnTaPoiqarfcSvyfW6cAD3ESf_dmrQ,1284
|
|
@@ -25,9 +25,9 @@ kea2/assets/fastbot_libs/arm64-v8a/libfastbot_native.so,sha256=dA2Tf74-gDrCFdeCl
|
|
|
25
25
|
kea2/assets/fastbot_libs/armeabi-v7a/libfastbot_native.so,sha256=GWcL8M8WfQAd9CfOM6pRYbOnxeycN-LiL7Mf59YIadE,1334420
|
|
26
26
|
kea2/assets/fastbot_libs/x86/libfastbot_native.so,sha256=k-aw1gEXRWMKZRNHIggKNuZy0wC1y2BnveJGEIO6rbo,2036856
|
|
27
27
|
kea2/assets/fastbot_libs/x86_64/libfastbot_native.so,sha256=tiofhlf4uMQcU5WAvrdLgTBME0lb83hVUoGtTwxmE8A,2121416
|
|
28
|
-
kea2_python-0.0.
|
|
29
|
-
kea2_python-0.0.
|
|
30
|
-
kea2_python-0.0.
|
|
31
|
-
kea2_python-0.0.
|
|
32
|
-
kea2_python-0.0.
|
|
33
|
-
kea2_python-0.0.
|
|
28
|
+
kea2_python-0.0.1a4.dist-info/licenses/LICENSE,sha256=nM9PPjcsXVo5SzNsjRqWgA-gdJlwqZZcRDSC6Qf6bVE,2034
|
|
29
|
+
kea2_python-0.0.1a4.dist-info/METADATA,sha256=jPLHS0mfjMj1RxQY1dKuvGnm7dsc7Z2fTunhz3WLwsk,19100
|
|
30
|
+
kea2_python-0.0.1a4.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
31
|
+
kea2_python-0.0.1a4.dist-info/entry_points.txt,sha256=mFX06TyxXiUAJQ6JZn8QHzfn8n5R8_KJ5W-pTm_fRCA,39
|
|
32
|
+
kea2_python-0.0.1a4.dist-info/top_level.txt,sha256=TsgNH4PQoNOVhegpO7AcjutMVWp6Z4KDL1pBH9FnMmk,5
|
|
33
|
+
kea2_python-0.0.1a4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|