Kea2-python 0.1.1__tar.gz → 0.1.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.1.1 → kea2_python-0.1.2}/Kea2_python.egg-info/PKG-INFO +3 -3
  2. {kea2_python-0.1.1 → kea2_python-0.1.2}/Kea2_python.egg-info/SOURCES.txt +1 -0
  3. {kea2_python-0.1.1 → kea2_python-0.1.2}/PKG-INFO +3 -3
  4. {kea2_python-0.1.1 → kea2_python-0.1.2}/README.md +2 -2
  5. kea2_python-0.1.2/kea2/assets/kea2-thirdpart.jar +0 -0
  6. kea2_python-0.1.2/kea2/assets/monkeyq.jar +0 -0
  7. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/assets/quicktest.py +3 -1
  8. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/bug_report_generator.py +3 -1
  9. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/fastbotManager.py +12 -2
  10. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/keaUtils.py +23 -9
  11. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/kea_launcher.py +10 -0
  12. {kea2_python-0.1.1 → kea2_python-0.1.2}/pyproject.toml +1 -1
  13. kea2_python-0.1.1/kea2/assets/monkeyq.jar +0 -0
  14. {kea2_python-0.1.1 → kea2_python-0.1.2}/Kea2_python.egg-info/dependency_links.txt +0 -0
  15. {kea2_python-0.1.1 → kea2_python-0.1.2}/Kea2_python.egg-info/entry_points.txt +0 -0
  16. {kea2_python-0.1.1 → kea2_python-0.1.2}/Kea2_python.egg-info/requires.txt +0 -0
  17. {kea2_python-0.1.1 → kea2_python-0.1.2}/Kea2_python.egg-info/top_level.txt +0 -0
  18. {kea2_python-0.1.1 → kea2_python-0.1.2}/LICENSE +0 -0
  19. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/__init__.py +0 -0
  20. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/absDriver.py +0 -0
  21. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/adbUtils.py +0 -0
  22. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/assets/fastbot-thirdpart.jar +0 -0
  23. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/assets/fastbot_configs/abl.strings +0 -0
  24. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/assets/fastbot_configs/awl.strings +0 -0
  25. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/assets/fastbot_configs/max.config +0 -0
  26. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/assets/fastbot_configs/max.fuzzing.strings +0 -0
  27. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/assets/fastbot_configs/max.schema.strings +0 -0
  28. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/assets/fastbot_configs/max.strings +0 -0
  29. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/assets/fastbot_configs/max.tree.pruning +0 -0
  30. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/assets/fastbot_configs/widget.block.py +0 -0
  31. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/assets/fastbot_libs/arm64-v8a/libfastbot_native.so +0 -0
  32. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/assets/fastbot_libs/armeabi-v7a/libfastbot_native.so +0 -0
  33. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/assets/fastbot_libs/x86/libfastbot_native.so +0 -0
  34. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/assets/fastbot_libs/x86_64/libfastbot_native.so +0 -0
  35. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/assets/framework.jar +0 -0
  36. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/cli.py +0 -0
  37. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/logWatcher.py +0 -0
  38. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/resultSyncer.py +0 -0
  39. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/templates/bug_report_template.html +0 -0
  40. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/u2Driver.py +0 -0
  41. {kea2_python-0.1.1 → kea2_python-0.1.2}/kea2/utils.py +0 -0
  42. {kea2_python-0.1.1 → kea2_python-0.1.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Kea2-python
3
- Version: 0.1.1
3
+ Version: 0.1.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
@@ -67,7 +67,7 @@ In the future, Kea2 will be extended to support
67
67
 
68
68
  Running environment:
69
69
  - support Windows, MacOS and Linux
70
- - python 3.8+, Android 4.4+ (Android SDK installed)
70
+ - python 3.8+, Android 5.0+ (Android SDK installed)
71
71
  - **VPN closed** (Features 2 and 3 required)
72
72
 
73
73
  Install Kea2 by `pip`:
@@ -251,4 +251,4 @@ Kea2 has also received many valuable insights, advices, feedbacks and lessons sh
251
251
 
252
252
  [^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)等。
253
253
 
254
- [^2]: 在UI自动化测试过程中支持自动断言是一个很重要的能力,但几乎没有测试工具提供这样的能力。我们注意到[AppCrawler](https://ceshiren.com/t/topic/15801/5)的开发者曾经希望提供一种断言机制,得到了用户的热切响应,不少用户从21年就开始催更,但始终未能实现。
254
+ [^2]: 在UI自动化测试过程中支持自动断言是一个很重要的能力,但几乎没有测试工具提供这样的能力。我们注意到[AppCrawler](https://ceshiren.com/t/topic/15801/5)的开发者曾经希望提供一种断言机制,得到了用户的热切响应,不少用户从21年就开始催更,但始终未能实现。
@@ -21,6 +21,7 @@ kea2/u2Driver.py
21
21
  kea2/utils.py
22
22
  kea2/assets/fastbot-thirdpart.jar
23
23
  kea2/assets/framework.jar
24
+ kea2/assets/kea2-thirdpart.jar
24
25
  kea2/assets/monkeyq.jar
25
26
  kea2/assets/quicktest.py
26
27
  kea2/assets/fastbot_configs/abl.strings
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Kea2-python
3
- Version: 0.1.1
3
+ Version: 0.1.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
@@ -67,7 +67,7 @@ In the future, Kea2 will be extended to support
67
67
 
68
68
  Running environment:
69
69
  - support Windows, MacOS and Linux
70
- - python 3.8+, Android 4.4+ (Android SDK installed)
70
+ - python 3.8+, Android 5.0+ (Android SDK installed)
71
71
  - **VPN closed** (Features 2 and 3 required)
72
72
 
73
73
  Install Kea2 by `pip`:
@@ -251,4 +251,4 @@ Kea2 has also received many valuable insights, advices, feedbacks and lessons sh
251
251
 
252
252
  [^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)等。
253
253
 
254
- [^2]: 在UI自动化测试过程中支持自动断言是一个很重要的能力,但几乎没有测试工具提供这样的能力。我们注意到[AppCrawler](https://ceshiren.com/t/topic/15801/5)的开发者曾经希望提供一种断言机制,得到了用户的热切响应,不少用户从21年就开始催更,但始终未能实现。
254
+ [^2]: 在UI自动化测试过程中支持自动断言是一个很重要的能力,但几乎没有测试工具提供这样的能力。我们注意到[AppCrawler](https://ceshiren.com/t/topic/15801/5)的开发者曾经希望提供一种断言机制,得到了用户的热切响应,不少用户从21年就开始催更,但始终未能实现。
@@ -54,7 +54,7 @@ In the future, Kea2 will be extended to support
54
54
 
55
55
  Running environment:
56
56
  - support Windows, MacOS and Linux
57
- - python 3.8+, Android 4.4+ (Android SDK installed)
57
+ - python 3.8+, Android 5.0+ (Android SDK installed)
58
58
  - **VPN closed** (Features 2 and 3 required)
59
59
 
60
60
  Install Kea2 by `pip`:
@@ -238,4 +238,4 @@ Kea2 has also received many valuable insights, advices, feedbacks and lessons sh
238
238
 
239
239
  [^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)等。
240
240
 
241
- [^2]: 在UI自动化测试过程中支持自动断言是一个很重要的能力,但几乎没有测试工具提供这样的能力。我们注意到[AppCrawler](https://ceshiren.com/t/topic/15801/5)的开发者曾经希望提供一种断言机制,得到了用户的热切响应,不少用户从21年就开始催更,但始终未能实现。
241
+ [^2]: 在UI自动化测试过程中支持自动断言是一个很重要的能力,但几乎没有测试工具提供这样的能力。我们注意到[AppCrawler](https://ceshiren.com/t/topic/15801/5)的开发者曾经希望提供一种断言机制,得到了用户的热切响应,不少用户从21年就开始催更,但始终未能实现。
@@ -81,7 +81,9 @@ if __name__ == "__main__":
81
81
  Driver=U2Driver,
82
82
  packageNames=[PACKAGE_NAME],
83
83
  # serial="emulator-5554", # specify the serial
84
- maxStep=5000,
84
+ maxStep=50,
85
+ profile_period=10,
86
+ take_screenshots=True, # whether to take screenshots, default is False
85
87
  # running_mins=10, # specify the maximal running time in minutes, default value is 10m
86
88
  # throttle=200, # specify the throttle in milliseconds, default value is 200ms
87
89
  agent="u2" # 'native' for running the vanilla Fastbot, 'u2' for running Kea2
@@ -68,7 +68,7 @@ class BugReportGenerator:
68
68
  with open(report_path, "w", encoding="utf-8") as f:
69
69
  f.write(html_content)
70
70
 
71
- logger.debug(f"Bug report generated: {report_path}")
71
+ logger.info(f"Bug report saved to: {report_path}")
72
72
 
73
73
  except Exception as e:
74
74
  logger.error(f"Error generating bug report: {e}")
@@ -323,6 +323,8 @@ class BugReportGenerator:
323
323
  if lines:
324
324
  # Collect coverage trend data
325
325
  for line in lines:
326
+ if not line.strip():
327
+ continue
326
328
  try:
327
329
  coverage_data = json.loads(line)
328
330
  data["coverage_trend"].append({
@@ -42,6 +42,11 @@ class FastbotManager:
42
42
  "/sdcard/fastbot-thirdpart.jar",
43
43
  device=options.serial,
44
44
  )
45
+ push_file(
46
+ Path.joinpath(cur_dir, "assets/kea2-thirdpart.jar"),
47
+ "/sdcard/kea2-thirdpart.jar",
48
+ device=options.serial,
49
+ )
45
50
  push_file(
46
51
  Path.joinpath(cur_dir, "assets/framework.jar"),
47
52
  "/sdcard/framework.jar",
@@ -91,7 +96,12 @@ class FastbotManager:
91
96
 
92
97
  def _startFastbotService(self) -> threading.Thread:
93
98
  shell_command = [
94
- "CLASSPATH=/sdcard/monkeyq.jar:/sdcard/framework.jar:/sdcard/fastbot-thirdpart.jar",
99
+ "CLASSPATH="
100
+ "/sdcard/monkeyq.jar:"
101
+ "/sdcard/framework.jar:"
102
+ "/sdcard/fastbot-thirdpart.jar:"
103
+ "/sdcard/kea2-thirdpart.jar",
104
+
95
105
  "exec", "app_process",
96
106
  "/system/bin", "com.android.commands.monkey.Monkey",
97
107
  "-p", *self.options.packageNames,
@@ -126,7 +136,7 @@ class FastbotManager:
126
136
  self.return_code = proc.wait()
127
137
  f.close()
128
138
  if self.return_code != 0:
129
- raise RuntimeError(f"Fastbot Error: Terminated with [code {self.return_code}]")
139
+ raise RuntimeError(f"Fastbot Error: Terminated with [code {self.return_code}] See {self.log_file} for details.")
130
140
 
131
141
  def get_return_code(self):
132
142
  if self.thread:
@@ -126,6 +126,8 @@ class Options:
126
126
  profile_period: int = 25
127
127
  # take screenshots for every step
128
128
  take_screenshots: bool = False
129
+ # The root of output dir on device
130
+ device_output_root: str = "/sdcard"
129
131
  # the debug mode
130
132
  debug: bool = False
131
133
 
@@ -135,10 +137,18 @@ class Options:
135
137
  super().__setattr__(name, value)
136
138
 
137
139
  def __post_init__(self):
140
+ import logging
141
+ logging.basicConfig(level=logging.DEBUG if self.debug else logging.INFO)
138
142
  if self.serial and self.Driver:
139
143
  self.Driver.setDeviceSerial(self.serial)
140
144
  global LOGFILE, RESFILE, STAMP
141
145
  if self.log_stamp:
146
+ illegal_chars = ['/', '\\', ':', '*', '?', '"', '<', '>', '|', '\n', '\r', '\t', '\0']
147
+ for char in illegal_chars:
148
+ if char in self.log_stamp:
149
+ raise ValueError(
150
+ f"char: `{char}` is illegal in --log-stamp. current stamp: {self.log_stamp}"
151
+ )
142
152
  STAMP = self.log_stamp
143
153
  self.output_dir = Path(self.output_dir).absolute() / f"res_{STAMP}"
144
154
  LOGFILE = f"fastbot_{STAMP}.log"
@@ -324,8 +334,9 @@ class KeaTestRunner(TextTestRunner):
324
334
  xml_raw = self.stepMonkey()
325
335
  propsSatisfiedPrecond = self.getValidProperties(xml_raw, result)
326
336
  except requests.ConnectionError:
337
+ logger.info("Connection refused by remote.")
327
338
  if fb.get_return_code() == 0:
328
- logger.info("[INFO] Exploration times up (--running-minutes).")
339
+ logger.info("Exploration times up (--running-minutes).")
329
340
  end_by_remote = True
330
341
  break
331
342
  raise RuntimeError("Fastbot Aborted.")
@@ -495,7 +506,8 @@ class KeaTestRunner(TextTestRunner):
495
506
  URL = f"http://localhost:{self.scriptDriver.lport}/init"
496
507
  data = {
497
508
  "takeScreenshots": self.options.take_screenshots,
498
- "Stamp": STAMP
509
+ "Stamp": STAMP,
510
+ "deviceOutputRoot": self.options.device_output_root,
499
511
  }
500
512
  print(f"[INFO] Init fastbot: {data}", flush=True)
501
513
  r = requests.post(
@@ -505,7 +517,7 @@ class KeaTestRunner(TextTestRunner):
505
517
  res = r.content.decode(encoding="utf-8")
506
518
  import re
507
519
  self.device_output_dir = re.match(r"outputDir:(.+)", res).group(1)
508
- print(f"[INFO] Fastbot initiated. Device outputDir: {res}", flush=True)
520
+ print(f"[INFO] Fastbot initiated. outputDir: {res}", flush=True)
509
521
 
510
522
  def collectAllProperties(self, test: TestSuite):
511
523
  """collect all the properties to prepare for PBT
@@ -652,15 +664,17 @@ class KeaTestRunner(TextTestRunner):
652
664
  def __del__(self):
653
665
  """tearDown method. Cleanup the env.
654
666
  """
655
- try:
656
- logger.debug("Generating test bug report")
657
- report_generator = BugReportGenerator(self.options.output_dir)
658
- report_generator.generate_report()
659
- except Exception as e:
660
- logger.error(f"Error generating bug report: {e}", flush=True)
661
667
  try:
662
668
  self.stopMonkey()
663
669
  except Exception as e:
664
670
  pass
671
+
665
672
  if self.options.Driver:
666
673
  self.options.Driver.tearDown()
674
+
675
+ try:
676
+ logger.info("Generating bug report")
677
+ report_generator = BugReportGenerator(self.options.output_dir)
678
+ report_generator.generate_report()
679
+ except Exception as e:
680
+ logger.error(f"Error generating bug report: {e}", flush=True)
@@ -91,6 +91,15 @@ def _set_runner_parser(subparsers: "argparse._SubParsersAction[argparse.Argument
91
91
  default=25,
92
92
  help="Steps to profile the testing statistics.",
93
93
  )
94
+
95
+ parser.add_argument(
96
+ "--device-output-root",
97
+ dest="device_output_root",
98
+ type=str,
99
+ required=False,
100
+ default="/sdcard",
101
+ help="The root of device output dir. (Saving tmp log files and screenshots)",
102
+ )
94
103
 
95
104
  parser.add_argument(
96
105
  "--take-screenshots",
@@ -171,6 +180,7 @@ def run(args=None):
171
180
  log_stamp=args.log_stamp,
172
181
  profile_period=args.profile_period,
173
182
  take_screenshots=args.take_screenshots,
183
+ device_output_root=args.device_output_root
174
184
  )
175
185
 
176
186
  KeaTestRunner.setOptions(options)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "Kea2-python"
3
- version = "0.1.1"
3
+ version = "0.1.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"
Binary file
File without changes
File without changes
File without changes
File without changes