Kea2-python 0.0.1a2__tar.gz → 0.0.1a3__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.
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/Kea2_python.egg-info/PKG-INFO +2 -2
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/PKG-INFO +2 -2
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/README.md +1 -1
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/absDriver.py +18 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/quickstart.py +2 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/cli.py +0 -2
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/keaUtils.py +8 -1
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/u2Driver.py +15 -7
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/pyproject.toml +1 -1
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/Kea2_python.egg-info/SOURCES.txt +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/Kea2_python.egg-info/dependency_links.txt +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/Kea2_python.egg-info/entry_points.txt +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/Kea2_python.egg-info/requires.txt +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/Kea2_python.egg-info/top_level.txt +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/LICENSE +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/__init__.py +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/adbUtils.py +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot-thirdpart.jar +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_configs/ADBKeyBoard.apk +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_configs/abl.strings +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_configs/awl.strings +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_configs/max.config +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_configs/max.fuzzing.strings +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_configs/max.schema.strings +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_configs/max.strings +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_configs/max.tree.pruning +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_configs/widget.block.py +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_libs/arm64-v8a/libfastbot_native.so +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_libs/armeabi-v7a/libfastbot_native.so +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_libs/x86/libfastbot_native.so +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_libs/x86_64/libfastbot_native.so +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/framework.jar +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/monkeyq.jar +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/u2.jar +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/kea_launcher.py +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/logWatcher.py +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/utils.py +0 -0
- {kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Kea2-python
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.1a3
|
|
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.9
|
|
@@ -27,7 +27,7 @@ These three features can be combined to customize and improve automated UI testi
|
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
|
|
30
|
-
> Kea2 is designed to be capable of fusing the (property-based) *
|
|
30
|
+
> Kea2 is designed to be capable of fusing the (property-based) *scripts* (e.g., written in uiautomator2) with automated UI testing tools (e.g., Fastbot), thus combining the strengths of human knowledge on app's business logics (empowered by the scripts) and random fuzzing. Many useful features (e.g., mimicing exploratory testing) can be implemented based on such a capability.
|
|
31
31
|
|
|
32
32
|
**The ability of the three features in Kea2**
|
|
33
33
|
| | **Feature 1** | **Feature 2** | **Feature 3** |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Kea2-python
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.1a3
|
|
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.9
|
|
@@ -27,7 +27,7 @@ These three features can be combined to customize and improve automated UI testi
|
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
|
|
30
|
-
> Kea2 is designed to be capable of fusing the (property-based) *
|
|
30
|
+
> Kea2 is designed to be capable of fusing the (property-based) *scripts* (e.g., written in uiautomator2) with automated UI testing tools (e.g., Fastbot), thus combining the strengths of human knowledge on app's business logics (empowered by the scripts) and random fuzzing. Many useful features (e.g., mimicing exploratory testing) can be implemented based on such a capability.
|
|
31
31
|
|
|
32
32
|
**The ability of the three features in Kea2**
|
|
33
33
|
| | **Feature 1** | **Feature 2** | **Feature 3** |
|
|
@@ -15,7 +15,7 @@ These three features can be combined to customize and improve automated UI testi
|
|
|
15
15
|
</div>
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
|
-
> Kea2 is designed to be capable of fusing the (property-based) *
|
|
18
|
+
> Kea2 is designed to be capable of fusing the (property-based) *scripts* (e.g., written in uiautomator2) with automated UI testing tools (e.g., Fastbot), thus combining the strengths of human knowledge on app's business logics (empowered by the scripts) and random fuzzing. Many useful features (e.g., mimicing exploratory testing) can be implemented based on such a capability.
|
|
19
19
|
|
|
20
20
|
**The ability of the three features in Kea2**
|
|
21
21
|
| | **Feature 1** | **Feature 2** | **Feature 3** |
|
|
@@ -2,12 +2,24 @@ import abc
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class AbstractScriptDriver(abc.ABC):
|
|
5
|
+
_instances = {}
|
|
6
|
+
def __new__(cls, *args, **kwargs):
|
|
7
|
+
if cls not in cls._instances:
|
|
8
|
+
cls._instances[cls] = super().__new__(cls)
|
|
9
|
+
return cls._instances[cls]
|
|
10
|
+
|
|
5
11
|
@abc.abstractmethod
|
|
6
12
|
def getInstance(self):
|
|
7
13
|
pass
|
|
8
14
|
|
|
9
15
|
|
|
10
16
|
class AbstractStaticChecker(abc.ABC):
|
|
17
|
+
_instances = {}
|
|
18
|
+
def __new__(cls, *args, **kwargs):
|
|
19
|
+
if cls not in cls._instances:
|
|
20
|
+
cls._instances[cls] = super().__new__(cls)
|
|
21
|
+
return cls._instances[cls]
|
|
22
|
+
|
|
11
23
|
@abc.abstractmethod
|
|
12
24
|
def getInstance(self):
|
|
13
25
|
pass
|
|
@@ -18,6 +30,12 @@ class AbstractStaticChecker(abc.ABC):
|
|
|
18
30
|
|
|
19
31
|
|
|
20
32
|
class AbstractDriver(abc.ABC):
|
|
33
|
+
_instances = {}
|
|
34
|
+
def __new__(cls, *args, **kwargs):
|
|
35
|
+
if cls not in cls._instances:
|
|
36
|
+
cls._instances[cls] = super().__new__(cls)
|
|
37
|
+
return cls._instances[cls]
|
|
38
|
+
|
|
21
39
|
@classmethod
|
|
22
40
|
@abc.abstractmethod
|
|
23
41
|
def setDeviceSerial(self):
|
|
@@ -164,8 +164,6 @@ def main():
|
|
|
164
164
|
args = parser.parse_args()
|
|
165
165
|
|
|
166
166
|
import logging
|
|
167
|
-
logging.getLogger("urllib3").setLevel(logging.INFO)
|
|
168
|
-
logging.getLogger("uiautomator2").setLevel(logging.INFO)
|
|
169
167
|
if args.debug:
|
|
170
168
|
logging.basicConfig(level=logging.DEBUG)
|
|
171
169
|
logger.debug("args: %s", args)
|
|
@@ -3,6 +3,7 @@ import os
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
import subprocess
|
|
5
5
|
import threading
|
|
6
|
+
import traceback
|
|
6
7
|
from typing import IO, Callable, Any, Dict, List, Literal, NewType, Optional, Union
|
|
7
8
|
from unittest import TextTestRunner, registerResult, TestSuite, TestCase, TextTestResult
|
|
8
9
|
import random
|
|
@@ -442,7 +443,13 @@ class KeaTestRunner(TextTestRunner):
|
|
|
442
443
|
# Dependency injection. Static driver checker for precond
|
|
443
444
|
setattr(test, self.options.driverName, staticCheckerDriver)
|
|
444
445
|
# excecute the precond
|
|
445
|
-
|
|
446
|
+
try:
|
|
447
|
+
if not precond(test):
|
|
448
|
+
valid = False
|
|
449
|
+
break
|
|
450
|
+
except Exception as e:
|
|
451
|
+
print(f"[ERROR] Error when checking precond: {getFullPropName(test)}", flush=True)
|
|
452
|
+
traceback.print_exc()
|
|
446
453
|
valid = False
|
|
447
454
|
break
|
|
448
455
|
# if all the precond passed. make it the candidate prop.
|
|
@@ -12,6 +12,10 @@ from .utils import TimeStamp
|
|
|
12
12
|
|
|
13
13
|
TIME_STAMP = TimeStamp().getTimeStamp()
|
|
14
14
|
|
|
15
|
+
import logging
|
|
16
|
+
logging.getLogger("urllib3").setLevel(logging.INFO)
|
|
17
|
+
logging.getLogger("uiautomator2").setLevel(logging.INFO)
|
|
18
|
+
|
|
15
19
|
"""
|
|
16
20
|
The definition of U2ScriptDriver
|
|
17
21
|
"""
|
|
@@ -29,13 +33,11 @@ class U2ScriptDriver(AbstractScriptDriver):
|
|
|
29
33
|
"""
|
|
30
34
|
|
|
31
35
|
deviceSerial: str = None
|
|
32
|
-
|
|
36
|
+
d = None
|
|
37
|
+
|
|
33
38
|
@classmethod
|
|
34
39
|
def setDeviceSerial(cls, deviceSerial):
|
|
35
40
|
cls.deviceSerial = deviceSerial
|
|
36
|
-
|
|
37
|
-
def __init__(self):
|
|
38
|
-
self.d = None
|
|
39
41
|
|
|
40
42
|
def getInstance(self):
|
|
41
43
|
if self.d is None:
|
|
@@ -117,7 +119,7 @@ class StaticU2UiObject(u2.UiObject):
|
|
|
117
119
|
|
|
118
120
|
@property
|
|
119
121
|
def exists(self):
|
|
120
|
-
dict.update(self.selector, {"covered": "
|
|
122
|
+
dict.update(self.selector, {"covered": "false"})
|
|
121
123
|
xpath = self._getXPath(self.selector)
|
|
122
124
|
matched_widgets = self.session.xml.xpath(xpath)
|
|
123
125
|
return bool(matched_widgets)
|
|
@@ -205,9 +207,11 @@ class _HindenWidgetFilter:
|
|
|
205
207
|
)
|
|
206
208
|
self._nodes.append(e)
|
|
207
209
|
|
|
210
|
+
|
|
208
211
|
class U2StaticDevice(u2.Device):
|
|
209
|
-
def __init__(self):
|
|
212
|
+
def __init__(self, script_driver):
|
|
210
213
|
self.xml: etree._Element = None
|
|
214
|
+
self._script_driver = script_driver
|
|
211
215
|
|
|
212
216
|
def __call__(self, **kwargs):
|
|
213
217
|
return StaticU2UiObject(session=self, selector=u2.Selector(**kwargs))
|
|
@@ -222,6 +226,10 @@ class U2StaticDevice(u2.Device):
|
|
|
222
226
|
get_page_source, xpathEntry
|
|
223
227
|
)
|
|
224
228
|
return xpathEntry
|
|
229
|
+
|
|
230
|
+
def __getattr__(self, attr):
|
|
231
|
+
"""Proxy other methods to script_driver"""
|
|
232
|
+
return getattr(self._script_driver, attr)
|
|
225
233
|
|
|
226
234
|
class _XPathEntry(u2.xpath.XPathEntry):
|
|
227
235
|
def __init__(self, d):
|
|
@@ -246,7 +254,7 @@ class U2StaticChecker(AbstractStaticChecker):
|
|
|
246
254
|
```
|
|
247
255
|
"""
|
|
248
256
|
def __init__(self):
|
|
249
|
-
self.d = U2StaticDevice()
|
|
257
|
+
self.d = U2StaticDevice(U2ScriptDriver().getInstance())
|
|
250
258
|
|
|
251
259
|
def setHierarchy(self, hierarchy: str):
|
|
252
260
|
if hierarchy is None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_libs/arm64-v8a/libfastbot_native.so
RENAMED
|
File without changes
|
|
File without changes
|
{kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_libs/x86/libfastbot_native.so
RENAMED
|
File without changes
|
{kea2_python-0.0.1a2 → kea2_python-0.0.1a3}/kea2/assets/fastbot_libs/x86_64/libfastbot_native.so
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|