Kea2-python 0.0.1a6__py3-none-any.whl → 0.0.1b0__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/keaUtils.py CHANGED
@@ -97,6 +97,10 @@ class Options:
97
97
  # the output_dir for saving logs and results
98
98
  output_dir: str = "output"
99
99
 
100
+ def __post_init__(self):
101
+ if self.serial and self.Driver:
102
+ self.Driver.setDeviceSerial(self.serial)
103
+
100
104
 
101
105
  @dataclass
102
106
  class PropStatistic:
kea2/kea_launcher.py CHANGED
@@ -130,7 +130,6 @@ def run(args=None):
130
130
 
131
131
  from kea2 import KeaTestRunner, Options
132
132
  from kea2.u2Driver import U2Driver
133
- U2Driver.setDeviceSerial(args.serial)
134
133
  options = Options(
135
134
  agent=args.agent,
136
135
  driverName=args.driver_name,
kea2/u2Driver.py CHANGED
@@ -88,7 +88,9 @@ class StaticU2UiObject(u2.UiObject):
88
88
  def _transferU2Keys(self, originKey):
89
89
  filterDict = {
90
90
  "resourceId": "resource-id",
91
- "description": "content-desc"
91
+ "description": "content-desc",
92
+ "className": "class",
93
+ "longClickable": "long-clickable",
92
94
  }
93
95
  if filterDict.get(originKey, None):
94
96
  return filterDict[originKey]
@@ -237,6 +239,7 @@ class _XPathEntry(u2.xpath.XPathEntry):
237
239
  super().__init__(d)
238
240
 
239
241
  def __call__(self, xpath, source = None):
242
+ # TODO fully support xpath in widget.block.py
240
243
  self.xpath = xpath
241
244
  return super().__call__(xpath, source)
242
245
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Kea2-python
3
- Version: 0.0.1a6
3
+ Version: 0.0.1b0
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
@@ -12,6 +12,10 @@ Dynamic: license-file
12
12
 
13
13
  # Introduction
14
14
 
15
+ [![PyPI](https://img.shields.io/pypi/v/kea2-python.svg)](https://pypi.python.org/pypi/kea2-python)
16
+ [![PyPI Downloads](https://static.pepy.tech/badge/kea2-python)](https://pepy.tech/projects/kea2-python)
17
+ ![Python](https://img.shields.io/badge/python-3.8%2B-blue)
18
+
15
19
  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
20
 
17
21
  ### Kea2 has three important features:
@@ -297,16 +301,30 @@ class MyFirstTest(unittest.TestCase):
297
301
  You can read [Kea - Write your fisrt property](https://kea-docs.readthedocs.io/en/latest/part-keaUserManuel/first_property.html) for more details.
298
302
 
299
303
  ### Notes
300
- Currently, in `@precondition` decorator and `widgets.block.py`. We only support basic selector (No parent-child relationship) and basic xpath (No chain call like `.xpath().xpath()`) in uiautomator2. The Script body in the function fully support uiautomator2.
301
-
304
+ Currently, in `@precondition` decorator and `widgets.block.py`. We only support basic selector (No parent-child relationship) in uiautomator2. The Script body in the function fully support uiautomator2.
302
305
 
303
306
  | | **Support** | **Not support** |
304
307
  | -- | -- | -- |
305
308
  | **Selctor** | `d(text="1").exist` | `d(text="1").child(text="2").exist` |
306
- | **XPath** | `d.xpath(".//[@text='1']")` | `d.xpath(".//[@text='1']").xpath(".//[@text]='2'")` |
307
309
 
308
310
  If you need to specify `parent-child` relation ship in `@precondition`, specify it in xpath.
309
311
 
312
+ for example:
313
+
314
+ ```python
315
+ # Do not use:
316
+ # @precondition(lambda self:
317
+ # self.d(className="android.widget.ListView").child(text="Bluetooth")
318
+ # ):
319
+ # ...
320
+
321
+ # Use
322
+ @precondition(lambda self:
323
+ self.d.xpath('//android.widget.ListView/*[@text="Bluetooth"]')
324
+ ):
325
+ ...
326
+ ```
327
+
310
328
 
311
329
  ## Launching Kea2
312
330
 
@@ -2,10 +2,10 @@ 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
4
  kea2/cli.py,sha256=eeXWf5aFCEYDKqL1o4qMcxhcCp6yG8twsjaXv0ZaTy0,2756
5
- kea2/keaUtils.py,sha256=7qip7u7QxjeujOGwyevOzbE5n8GURLTh8YjxzFp8y_s,20182
6
- kea2/kea_launcher.py,sha256=m58wi1_L4TrvSjIhkYDNVHljBixXoRe7oUvu59rjBtM,4175
5
+ kea2/keaUtils.py,sha256=wu_FHlLAO8cj69XpP02sRb0xaJqGuW79uH9onNXD0Ag,20305
6
+ kea2/kea_launcher.py,sha256=RzAoX9T0zoJzYIE-PeIcg7eNWPzwUSsBvA17nObTnpk,4133
7
7
  kea2/logWatcher.py,sha256=hd8banPiCa6aCQ6d_MznWKOdzK_A2X_dPbrx-usjxgE,1927
8
- kea2/u2Driver.py,sha256=NE7Q6OUB9DtoLueZO7ruZoRE3Wp0dp_-R4QHRDLaBvE,10507
8
+ kea2/u2Driver.py,sha256=8j21Rcb9ZuqBIU68Hcx1S_gl6zJ_ZngbIUMxXBBQpEU,10643
9
9
  kea2/utils.py,sha256=zjuoVwts2qVX9GnTaPoiqarfcSvyfW6cAD3ESf_dmrQ,1284
10
10
  kea2/assets/fastbot-thirdpart.jar,sha256=0SZ_OoZFWDGMnazgXKceHgKvXdUDoIa3Gb2bcifaikk,85664
11
11
  kea2/assets/framework.jar,sha256=rTluOJJKj2DFwh7ascXso1udYdWv00BxBwSQ3Vmv-fw,1149240
@@ -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.1a6.dist-info/licenses/LICENSE,sha256=nM9PPjcsXVo5SzNsjRqWgA-gdJlwqZZcRDSC6Qf6bVE,2034
29
- kea2_python-0.0.1a6.dist-info/METADATA,sha256=_rHEYL7NmHlRQpX5AJid0jbMWhTkxD91IOAJRzkuF5k,22079
30
- kea2_python-0.0.1a6.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
31
- kea2_python-0.0.1a6.dist-info/entry_points.txt,sha256=mFX06TyxXiUAJQ6JZn8QHzfn8n5R8_KJ5W-pTm_fRCA,39
32
- kea2_python-0.0.1a6.dist-info/top_level.txt,sha256=TsgNH4PQoNOVhegpO7AcjutMVWp6Z4KDL1pBH9FnMmk,5
33
- kea2_python-0.0.1a6.dist-info/RECORD,,
28
+ kea2_python-0.0.1b0.dist-info/licenses/LICENSE,sha256=nM9PPjcsXVo5SzNsjRqWgA-gdJlwqZZcRDSC6Qf6bVE,2034
29
+ kea2_python-0.0.1b0.dist-info/METADATA,sha256=NTKDhgUHAHCtc-jt8YRBpagrG8eZJncQFh9W-GWhV10,22456
30
+ kea2_python-0.0.1b0.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
31
+ kea2_python-0.0.1b0.dist-info/entry_points.txt,sha256=mFX06TyxXiUAJQ6JZn8QHzfn8n5R8_KJ5W-pTm_fRCA,39
32
+ kea2_python-0.0.1b0.dist-info/top_level.txt,sha256=TsgNH4PQoNOVhegpO7AcjutMVWp6Z4KDL1pBH9FnMmk,5
33
+ kea2_python-0.0.1b0.dist-info/RECORD,,