Kea2-python 0.2.1__tar.gz → 0.2.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 (42) hide show
  1. {kea2_python-0.2.1 → kea2_python-0.2.2}/Kea2_python.egg-info/PKG-INFO +2 -2
  2. {kea2_python-0.2.1 → kea2_python-0.2.2}/PKG-INFO +2 -2
  3. {kea2_python-0.2.1 → kea2_python-0.2.2}/README.md +1 -1
  4. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/fastbotManager.py +23 -0
  5. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/keaUtils.py +16 -11
  6. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/kea_launcher.py +19 -1
  7. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/logWatcher.py +1 -1
  8. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/u2Driver.py +3 -2
  9. {kea2_python-0.2.1 → kea2_python-0.2.2}/pyproject.toml +1 -1
  10. {kea2_python-0.2.1 → kea2_python-0.2.2}/tests/test_u2Selector.py +9 -3
  11. {kea2_python-0.2.1 → kea2_python-0.2.2}/Kea2_python.egg-info/SOURCES.txt +0 -0
  12. {kea2_python-0.2.1 → kea2_python-0.2.2}/Kea2_python.egg-info/dependency_links.txt +0 -0
  13. {kea2_python-0.2.1 → kea2_python-0.2.2}/Kea2_python.egg-info/entry_points.txt +0 -0
  14. {kea2_python-0.2.1 → kea2_python-0.2.2}/Kea2_python.egg-info/requires.txt +0 -0
  15. {kea2_python-0.2.1 → kea2_python-0.2.2}/Kea2_python.egg-info/top_level.txt +0 -0
  16. {kea2_python-0.2.1 → kea2_python-0.2.2}/LICENSE +0 -0
  17. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/__init__.py +0 -0
  18. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/absDriver.py +0 -0
  19. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/adbUtils.py +0 -0
  20. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/fastbot-thirdpart.jar +0 -0
  21. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/fastbot_configs/abl.strings +0 -0
  22. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/fastbot_configs/awl.strings +0 -0
  23. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/fastbot_configs/max.config +0 -0
  24. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/fastbot_configs/max.fuzzing.strings +0 -0
  25. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/fastbot_configs/max.schema.strings +0 -0
  26. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/fastbot_configs/max.strings +0 -0
  27. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/fastbot_configs/max.tree.pruning +0 -0
  28. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/fastbot_configs/widget.block.py +0 -0
  29. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/fastbot_libs/arm64-v8a/libfastbot_native.so +0 -0
  30. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/fastbot_libs/armeabi-v7a/libfastbot_native.so +0 -0
  31. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/fastbot_libs/x86/libfastbot_native.so +0 -0
  32. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/fastbot_libs/x86_64/libfastbot_native.so +0 -0
  33. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/framework.jar +0 -0
  34. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/kea2-thirdpart.jar +0 -0
  35. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/monkeyq.jar +0 -0
  36. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/assets/quicktest.py +0 -0
  37. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/bug_report_generator.py +0 -0
  38. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/cli.py +0 -0
  39. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/resultSyncer.py +0 -0
  40. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/templates/bug_report_template.html +0 -0
  41. {kea2_python-0.2.1 → kea2_python-0.2.2}/kea2/utils.py +0 -0
  42. {kea2_python-0.2.1 → kea2_python-0.2.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Kea2-python
3
- Version: 0.2.1
3
+ Version: 0.2.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
@@ -20,7 +20,7 @@ Dynamic: license-file
20
20
 
21
21
 
22
22
  <div>
23
- <img src="https://github.com/user-attachments/assets/aa5839fc-4542-46f6-918b-c9f891356c84" style="border-radius: 14px; width: 20%; height: 20%;"/>
23
+ <img src="https://github.com/user-attachments/assets/36ec9f2f-a3d8-482a-9a61-4785f3278991" style="border-radius: 14px; width: 20%; height: 20%;"/>
24
24
  </div>
25
25
 
26
26
  ### Github repo link
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Kea2-python
3
- Version: 0.2.1
3
+ Version: 0.2.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
@@ -20,7 +20,7 @@ Dynamic: license-file
20
20
 
21
21
 
22
22
  <div>
23
- <img src="https://github.com/user-attachments/assets/aa5839fc-4542-46f6-918b-c9f891356c84" style="border-radius: 14px; width: 20%; height: 20%;"/>
23
+ <img src="https://github.com/user-attachments/assets/36ec9f2f-a3d8-482a-9a61-4785f3278991" style="border-radius: 14px; width: 20%; height: 20%;"/>
24
24
  </div>
25
25
 
26
26
  ### Github repo link
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
  <div>
9
- <img src="https://github.com/user-attachments/assets/aa5839fc-4542-46f6-918b-c9f891356c84" style="border-radius: 14px; width: 20%; height: 20%;"/>
9
+ <img src="https://github.com/user-attachments/assets/36ec9f2f-a3d8-482a-9a61-4785f3278991" style="border-radius: 14px; width: 20%; height: 20%;"/>
10
10
  </div>
11
11
 
12
12
  ### Github repo link
@@ -70,6 +70,21 @@ class FastbotManager:
70
70
  "/data/local/tmp/x86_64/libfastbot_native.so",
71
71
  )
72
72
 
73
+ whitelist = self.options.act_whitelist_file
74
+ blacklist = self.options.act_blacklist_file
75
+ if bool(whitelist) ^ bool(blacklist):
76
+ if whitelist:
77
+ file_to_push = cur_dir.parent / 'configs' / 'awl.strings'
78
+ remote_path = whitelist
79
+ else:
80
+ file_to_push = cur_dir.parent / 'configs' / 'abl.strings'
81
+ remote_path = blacklist
82
+
83
+ self.dev.sync.push(
84
+ file_to_push,
85
+ remote_path
86
+ )
87
+
73
88
  t = self._startFastbotService()
74
89
  logger.info("Running Fastbot...")
75
90
 
@@ -167,6 +182,14 @@ class FastbotManager:
167
182
  if self.options.profile_period:
168
183
  shell_command += ["--profile-period", f"{self.options.profile_period}"]
169
184
 
185
+ whitelist = self.options.act_whitelist_file
186
+ blacklist = self.options.act_blacklist_file
187
+ if bool(whitelist) ^ bool(blacklist):
188
+ if whitelist:
189
+ shell_command += ["--act-whitelist-file", f"{whitelist}"]
190
+ else:
191
+ shell_command += ["--act-blacklist-file", f"{blacklist}"]
192
+
170
193
  shell_command += ["-v", "-v", "-v"]
171
194
 
172
195
  full_cmd = ["adb"] + (["-s", self.options.serial] if self.options.serial else []) + ["shell"] + shell_command
@@ -9,14 +9,15 @@ import random
9
9
  import warnings
10
10
  from dataclasses import dataclass, asdict
11
11
  import requests
12
- from .absDriver import AbstractDriver
12
+ from kea2.absDriver import AbstractDriver
13
13
  from functools import wraps
14
- from .bug_report_generator import BugReportGenerator
15
- from .resultSyncer import ResultSyncer
16
- from .logWatcher import LogWatcher
17
- from .utils import TimeStamp, getProjectRoot, getLogger
18
- from .u2Driver import StaticU2UiObject
19
- from .fastbotManager import FastbotManager
14
+ from kea2.bug_report_generator import BugReportGenerator
15
+ from kea2.resultSyncer import ResultSyncer
16
+ from kea2.logWatcher import LogWatcher
17
+ from kea2.utils import TimeStamp, getProjectRoot, getLogger
18
+ from kea2.u2Driver import StaticU2UiObject
19
+ from kea2.fastbotManager import FastbotManager
20
+ from kea2.adbUtils import ADBDevice
20
21
  import uiautomator2 as u2
21
22
  import types
22
23
 
@@ -133,6 +134,10 @@ class Options:
133
134
  device_output_root: str = "/sdcard"
134
135
  # the debug mode
135
136
  debug: bool = False
137
+ # Activity WhiteList File
138
+ act_whitelist_file: str = None
139
+ # Activity BlackList File
140
+ act_blacklist_file: str = None
136
141
 
137
142
  def __setattr__(self, name, value):
138
143
  if value is None:
@@ -149,6 +154,7 @@ class Options:
149
154
  if self.transport_id:
150
155
  target_device["transport_id"] = self.transport_id
151
156
  self.Driver.setDevice(target_device)
157
+ ADBDevice.setDevice(self.serial, self.transport_id)
152
158
  global LOGFILE, RESFILE, STAMP
153
159
  if self.log_stamp:
154
160
  illegal_chars = ['/', '\\', ':', '*', '?', '"', '<', '>', '|', '\n', '\r', '\t', '\0']
@@ -170,12 +176,11 @@ class Options:
170
176
  if self.throttle < 0:
171
177
  raise ValueError("--throttle should be greater than or equal to 0")
172
178
 
173
- _check_package_installation(self.serial, self.packageNames)
179
+ _check_package_installation(self.packageNames)
174
180
 
175
181
 
176
- def _check_package_installation(serial, packageNames):
177
- from .adbUtils import get_packages
178
- installed_packages = get_packages(device=serial)
182
+ def _check_package_installation(packageNames):
183
+ installed_packages = set(ADBDevice().list_packages())
179
184
 
180
185
  for package in packageNames:
181
186
  if package not in installed_packages:
@@ -122,6 +122,22 @@ def _set_runner_parser(subparsers: "argparse._SubParsersAction[argparse.Argument
122
122
  help="Take screenshots for every step.",
123
123
  )
124
124
 
125
+ parser.add_argument(
126
+ "--act-whitelist-file",
127
+ dest="act_whitelist_file",
128
+ required=False,
129
+ type=str,
130
+ help="Add Activity Whitelist File.",
131
+ )
132
+
133
+ parser.add_argument(
134
+ "--act-blacklist-file",
135
+ dest="act_blacklist_file",
136
+ required=False,
137
+ type=str,
138
+ help="Add Activity Blacklist File.",
139
+ )
140
+
125
141
  parser.add_argument(
126
142
  "extra",
127
143
  nargs=argparse.REMAINDER,
@@ -195,7 +211,9 @@ def run(args=None):
195
211
  log_stamp=args.log_stamp,
196
212
  profile_period=args.profile_period,
197
213
  take_screenshots=args.take_screenshots,
198
- device_output_root=args.device_output_root
214
+ device_output_root=args.device_output_root,
215
+ act_whitelist_file = args.act_whitelist_file,
216
+ act_blacklist_file=args.act_blacklist_file
199
217
  )
200
218
 
201
219
  KeaTestRunner.setOptions(options)
@@ -24,7 +24,7 @@ class LogWatcher:
24
24
  def watcher(self, poll_interval=3):
25
25
  self.last_pos = 0
26
26
 
27
- with open(self.log_file, "r") as fp:
27
+ with open(self.log_file, "r", encoding="utf-8") as fp:
28
28
  while not self.end_flag:
29
29
  self.read_log(fp)
30
30
  time.sleep(poll_interval)
@@ -285,13 +285,14 @@ class _HindenWidgetFilter:
285
285
 
286
286
 
287
287
  class U2StaticDevice(u2.Device):
288
- def __init__(self, script_driver):
288
+ def __init__(self, script_driver=None):
289
289
  self.xml: etree._Element = None
290
290
  self._script_driver = script_driver
291
291
 
292
292
  def __call__(self, **kwargs):
293
293
  ui = StaticU2UiObject(session=self, selector=u2.Selector(**kwargs))
294
- ui.jsonrpc = self._script_driver.jsonrpc
294
+ if self._script_driver:
295
+ ui.jsonrpc = self._script_driver.jsonrpc
295
296
  return ui
296
297
 
297
298
  @property
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "Kea2-python"
3
- version = "0.2.1"
3
+ version = "0.2.2"
4
4
  description = "A python library for supporting and customizing automated UI testing for mobile apps"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.8"
@@ -1,16 +1,22 @@
1
1
  import unittest
2
- from kea2.u2Driver import _HindenWidgetFilter, U2Driver
2
+ from kea2.u2Driver import U2StaticChecker, U2StaticDevice
3
3
  from lxml import etree
4
4
  from pathlib import Path
5
5
 
6
6
 
7
+
7
8
  XML_PATH = Path(__file__).parent / "hidden_widget_test.xml"
8
9
 
9
10
 
11
+ class U2StaticCheckerForTest(U2StaticChecker):
12
+ def __init__(self):
13
+ self.d = U2StaticDevice(script_driver=None)
14
+
15
+
10
16
  def get_static_checker():
11
17
  xml: etree._ElementTree = etree.parse(XML_PATH)
12
- d = U2Driver.getStaticChecker(xml)
13
- return d
18
+ d = U2StaticCheckerForTest()
19
+ return d.getInstance(xml)
14
20
 
15
21
 
16
22
  class TestHiddenWidget(unittest.TestCase):
File without changes
File without changes
File without changes
File without changes