AltTester-Driver 2.1.1__tar.gz → 2.2.0__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.
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/AltTester_Driver.egg-info/PKG-INFO +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/AltTester_Driver.egg-info/SOURCES.txt +1 -0
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/PKG-INFO +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/__init__.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/__version__.py +2 -2
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/_websocket.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/altdriver.py +29 -17
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/altobject.py +26 -3
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/by.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/AltTesterCommands/__init__.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/AltTesterCommands/add_notification_listener.py +4 -4
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/AltTesterCommands/remove_notification_listener.py +3 -2
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/AltTesterCommands/reset_input.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/AltTesterCommands/set_server_logging.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/FindObjects/__init__.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/FindObjects/find_object.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/FindObjects/find_object_at_coordinates.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/FindObjects/find_object_which_contains.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/FindObjects/find_objects.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/FindObjects/find_objects_which_contains.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/FindObjects/wait_for_component_property.py +10 -3
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/FindObjects/wait_for_object.py +3 -2
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/FindObjects/wait_for_object_to_not_be_present.py +3 -2
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/FindObjects/wait_for_object_which_contains.py +3 -2
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/__init__.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/begin_touch.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/click_coordinates.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/end_touch.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/keys_down.py +2 -2
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/keys_up.py +2 -2
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/move_mouse.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/move_touch.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/multi_point_swipe.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/press_keys.py +2 -2
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/scroll_mouse.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/swipe.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/tap_coordinates.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/tilt.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/Notifications/__init__.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/Notifications/base_notification_callbacks.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/Notifications/load_scene_mode.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/Notifications/load_scene_notification_result.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/Notifications/log_notification_result.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/Notifications/notification_type.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/ObjectCommands/__init__.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/ObjectCommands/call_method.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/ObjectCommands/click_element.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/ObjectCommands/get_all_components.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/ObjectCommands/get_component_property.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/ObjectCommands/get_text.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/ObjectCommands/pointer_down.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/ObjectCommands/pointer_enter.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/ObjectCommands/pointer_exit.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/ObjectCommands/pointer_up.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/ObjectCommands/set_component_property.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/ObjectCommands/set_text.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/ObjectCommands/tap_element.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/UnityCommands/__init__.py +2 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/UnityCommands/delete_player_pref.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/UnityCommands/delete_player_pref_key.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/UnityCommands/get_all_loaded_scenes.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/UnityCommands/get_current_scene.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/UnityCommands/get_player_pref_key.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/UnityCommands/get_time_scale.py +1 -1
- alttester_driver-2.2.0/alttester/commands/UnityCommands/get_visual_element_property.py +40 -0
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/UnityCommands/load_scene.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/UnityCommands/set_player_pref_key.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/UnityCommands/set_time_scale.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/UnityCommands/unload_scene.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/UnityCommands/wait_for_current_scene_to_be.py +3 -2
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/__init__.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/base_command.py +24 -11
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/get_png_screenshot.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/get_server_version.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/get_static_property.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/set_static_property.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/exceptions.py +9 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/keycode.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/logging.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/playerpref.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/reverse_port_forwarding.py +20 -5
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/setup.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/integration/__init__.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/integration/conftest.py +7 -7
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/integration/test_driver.py +39 -36
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/integration/test_notifications.py +21 -20
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/integration/test_reverse_port_forwarding.py +8 -8
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/integration/test_scene01_part1.py +115 -90
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/integration/test_scene01_part2.py +113 -112
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/integration/test_scene02.py +18 -18
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/integration/test_scene03.py +18 -18
- alttester_driver-2.2.0/tests/integration/test_scene05.py +145 -0
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/integration/test_scene07.py +33 -26
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/integration/test_scene09.py +14 -11
- alttester_driver-2.2.0/tests/integration/test_scene10.py +122 -0
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/integration/utils.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/unit/__init__.py +1 -1
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/unit/test_altobject.py +3 -2
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/unit/test_commands.py +3 -2
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/tests/unit/test_websocket.py +7 -4
- alttester_driver-2.1.1/tests/integration/test_scene05.py +0 -131
- alttester_driver-2.1.1/tests/integration/test_scene10.py +0 -110
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/AltTester_Driver.egg-info/dependency_links.txt +0 -0
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/AltTester_Driver.egg-info/not-zip-safe +0 -0
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/AltTester_Driver.egg-info/requires.txt +0 -0
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/AltTester_Driver.egg-info/top_level.txt +0 -0
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/MANIFEST.in +0 -0
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/README.md +0 -0
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/requirements-dev.txt +0 -0
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/requirements.txt +0 -0
- {alttester_driver-2.1.1 → alttester_driver-2.2.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: AltTester-Driver
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Python bindings for the AltTester® framework. AltTester® is an open-source UI driven test automation tool that helps you find objects in your game and interacts with them.
|
|
5
5
|
Home-page: https://alttester.com/docs/sdk/latest/
|
|
6
6
|
Author: Altom Consulting
|
|
@@ -81,6 +81,7 @@ alttester/commands/UnityCommands/get_all_loaded_scenes.py
|
|
|
81
81
|
alttester/commands/UnityCommands/get_current_scene.py
|
|
82
82
|
alttester/commands/UnityCommands/get_player_pref_key.py
|
|
83
83
|
alttester/commands/UnityCommands/get_time_scale.py
|
|
84
|
+
alttester/commands/UnityCommands/get_visual_element_property.py
|
|
84
85
|
alttester/commands/UnityCommands/load_scene.py
|
|
85
86
|
alttester/commands/UnityCommands/set_player_pref_key.py
|
|
86
87
|
alttester/commands/UnityCommands/set_time_scale.py
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: AltTester-Driver
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Python bindings for the AltTester® framework. AltTester® is an open-source UI driven test automation tool that helps you find objects in your game and interacts with them.
|
|
5
5
|
Home-page: https://alttester.com/docs/sdk/latest/
|
|
6
6
|
Author: Altom Consulting
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright(C)
|
|
2
|
+
Copyright(C) 2024 Altom Consulting
|
|
3
3
|
|
|
4
4
|
This program is free software: you can redistribute it and/or modify
|
|
5
5
|
it under the terms of the GNU General Public License as published by
|
|
@@ -15,4 +15,4 @@
|
|
|
15
15
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
|
-
VERSION = "2.
|
|
18
|
+
VERSION = "2.2.0"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright(C)
|
|
2
|
+
Copyright(C) 2024 Altom Consulting
|
|
3
3
|
|
|
4
4
|
This program is free software: you can redistribute it and/or modify
|
|
5
5
|
it under the terms of the GNU General Public License as published by
|
|
@@ -28,7 +28,8 @@ from alttester.altobject import AltObject
|
|
|
28
28
|
from alttester.by import By
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
warnings.filterwarnings(
|
|
31
|
+
warnings.filterwarnings(
|
|
32
|
+
"default", category=DeprecationWarning, module=__name__)
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
class AltDriver:
|
|
@@ -116,7 +117,8 @@ class AltDriver:
|
|
|
116
117
|
logger.configure(
|
|
117
118
|
handlers=[
|
|
118
119
|
dict(sink=sys.stdout, diagnose=False),
|
|
119
|
-
dict(sink="./AltTester.log", enqueue=False,
|
|
120
|
+
dict(sink="./AltTester.log", enqueue=False,
|
|
121
|
+
serialize=True, mode="w", diagnose=False),
|
|
120
122
|
],
|
|
121
123
|
levels=[dict(name="DEBUG")],
|
|
122
124
|
activation=[("alttester", True)],
|
|
@@ -131,17 +133,20 @@ class AltDriver:
|
|
|
131
133
|
|
|
132
134
|
def _check_server_version(self):
|
|
133
135
|
server_version = commands.GetServerVersion.run(self._connection)
|
|
134
|
-
logger.info("Connection established with instrumented Unity app. AltTester(R) Version: {}"
|
|
136
|
+
logger.info("Connection established with instrumented Unity app. AltTester(R) Version: {}".format(
|
|
137
|
+
server_version))
|
|
135
138
|
|
|
136
139
|
major_server, minor_server = self._split_version(server_version)
|
|
137
|
-
major_driver, minor_driver = self._split_version(VERSION)
|
|
138
140
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
VERSION,
|
|
142
|
-
server_version
|
|
143
|
-
)
|
|
141
|
+
server_major = int(major_server)
|
|
142
|
+
server_minor = int(minor_server)
|
|
144
143
|
|
|
144
|
+
is_supported = (server_major == 2 and server_minor == 2) or (
|
|
145
|
+
server_major == 1 and server_minor == 0)
|
|
146
|
+
|
|
147
|
+
if not is_supported:
|
|
148
|
+
message = "Version mismatch. AltDriver version is {}. AltTester(R) version is {}.".format(
|
|
149
|
+
VERSION, server_version)
|
|
145
150
|
logger.warning(message)
|
|
146
151
|
|
|
147
152
|
def _get_alt_object(self, data):
|
|
@@ -640,7 +645,8 @@ class AltDriver:
|
|
|
640
645
|
|
|
641
646
|
"""
|
|
642
647
|
|
|
643
|
-
commands.ClickCoordinates.run(
|
|
648
|
+
commands.ClickCoordinates.run(
|
|
649
|
+
self._connection, coordinates, count, interval, wait)
|
|
644
650
|
|
|
645
651
|
def key_down(self, key_code, power=1):
|
|
646
652
|
"""Simulates that a specific key was pressed without taking into consideration the duration of the press.
|
|
@@ -712,7 +718,8 @@ class AltDriver:
|
|
|
712
718
|
|
|
713
719
|
"""
|
|
714
720
|
|
|
715
|
-
commands.PressKeys.run(
|
|
721
|
+
commands.PressKeys.run(
|
|
722
|
+
self._connection, key_codes, power, duration, wait)
|
|
716
723
|
|
|
717
724
|
def begin_touch(self, coordinates):
|
|
718
725
|
"""Simulates starting of a touch on the screen.
|
|
@@ -778,7 +785,8 @@ class AltDriver:
|
|
|
778
785
|
|
|
779
786
|
"""
|
|
780
787
|
|
|
781
|
-
commands.MultipointSwipe.run(
|
|
788
|
+
commands.MultipointSwipe.run(
|
|
789
|
+
self._connection, positions, duration, wait)
|
|
782
790
|
|
|
783
791
|
def tap(self, coordinates, count=1, interval=0.1, wait=True):
|
|
784
792
|
"""Tap at screen coordinates.
|
|
@@ -791,7 +799,8 @@ class AltDriver:
|
|
|
791
799
|
|
|
792
800
|
"""
|
|
793
801
|
|
|
794
|
-
commands.TapCoordinates.run(
|
|
802
|
+
commands.TapCoordinates.run(
|
|
803
|
+
self._connection, coordinates, count, interval, wait)
|
|
795
804
|
|
|
796
805
|
def tilt(self, acceleration, duration=0.1, wait=True):
|
|
797
806
|
"""Simulates device rotation action in your application.
|
|
@@ -891,7 +900,8 @@ class AltDriver:
|
|
|
891
900
|
|
|
892
901
|
"""
|
|
893
902
|
|
|
894
|
-
data = commands.FindObjectAtCoordinates.run(
|
|
903
|
+
data = commands.FindObjectAtCoordinates.run(
|
|
904
|
+
self._connection, coordinates)
|
|
895
905
|
return self._get_alt_object(data)
|
|
896
906
|
|
|
897
907
|
def add_notification_listener(self, notification_type, notification_callback, overwrite=True):
|
|
@@ -905,7 +915,8 @@ class AltDriver:
|
|
|
905
915
|
|
|
906
916
|
"""
|
|
907
917
|
|
|
908
|
-
commands.AddNotificationListener.run(
|
|
918
|
+
commands.AddNotificationListener.run(
|
|
919
|
+
self._connection, notification_type, notification_callback, overwrite)
|
|
909
920
|
|
|
910
921
|
def remove_notification_listener(self, notification_type):
|
|
911
922
|
"""Clear list of callback for the notification type and turn off the notification in tester.
|
|
@@ -915,7 +926,8 @@ class AltDriver:
|
|
|
915
926
|
|
|
916
927
|
"""
|
|
917
928
|
|
|
918
|
-
commands.RemoveNotificationListener.run(
|
|
929
|
+
commands.RemoveNotificationListener.run(
|
|
930
|
+
self._connection, notification_type)
|
|
919
931
|
|
|
920
932
|
def reset_input(self):
|
|
921
933
|
"""Clear all active input actions simulated by AltTester."""
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright(C)
|
|
2
|
+
Copyright(C) 2024 Altom Consulting
|
|
3
3
|
|
|
4
4
|
This program is free software: you can redistribute it and/or modify
|
|
5
5
|
it under the terms of the GNU General Public License as published by
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
import alttester.commands as commands
|
|
21
|
+
import alttester.exceptions as exceptions
|
|
21
22
|
from alttester.by import By
|
|
22
23
|
|
|
23
24
|
|
|
@@ -163,7 +164,8 @@ class AltObject:
|
|
|
163
164
|
return commands.GetAllComponents.run(self._connection, self)
|
|
164
165
|
|
|
165
166
|
def wait_for_component_property(self, component_name, property_name,
|
|
166
|
-
property_value, assembly, timeout=20, interval=0.5
|
|
167
|
+
property_value, assembly, timeout=20, interval=0.5,
|
|
168
|
+
get_property_as_string=False, max_depth=2):
|
|
167
169
|
"""Wait until a property has a specific value and returns the value of the given component property.
|
|
168
170
|
|
|
169
171
|
Args:
|
|
@@ -177,6 +179,10 @@ class AltObject:
|
|
|
177
179
|
timeout (:obj:`int`, optional): The number of seconds that it will wait for property.
|
|
178
180
|
interval (:obj:`float`, optional): The number of seconds after which it will try to find the object again.
|
|
179
181
|
The interval should be smaller than timeout.
|
|
182
|
+
get_property_as_string (:obj:`bool`, optional): A boolean value that makes the property_value
|
|
183
|
+
to be compared as a string with the property from the instrumented app.
|
|
184
|
+
max_depth (:obj:`int`, optional): An integer value that defines the maximum level from which to retrieve
|
|
185
|
+
properties.
|
|
180
186
|
|
|
181
187
|
Returns:
|
|
182
188
|
str: The property value is serialized to a JSON string.
|
|
@@ -184,7 +190,7 @@ class AltObject:
|
|
|
184
190
|
"""
|
|
185
191
|
return commands.WaitForComponentProperty.run(
|
|
186
192
|
component_name, property_name, property_value,
|
|
187
|
-
assembly, self, timeout, interval
|
|
193
|
+
assembly, self, timeout, interval, get_property_as_string, max_depth
|
|
188
194
|
)
|
|
189
195
|
|
|
190
196
|
def get_component_property(self, component_name, property_name, assembly, max_depth=2):
|
|
@@ -363,3 +369,20 @@ class AltObject:
|
|
|
363
369
|
self, count, interval, wait
|
|
364
370
|
)
|
|
365
371
|
return AltObject(self._altdriver, data)
|
|
372
|
+
|
|
373
|
+
def get_visual_element_property(self, property_name: str) -> str:
|
|
374
|
+
"""Gets a value for a given visual element property.
|
|
375
|
+
|
|
376
|
+
Args:
|
|
377
|
+
property_name: The name of the property of which value you want to get.
|
|
378
|
+
|
|
379
|
+
Returns:
|
|
380
|
+
The property value is serialized to a JSON string.
|
|
381
|
+
|
|
382
|
+
Raises:
|
|
383
|
+
WrongAltObjectTypeException: The method is called on an object that is not a VisualElement.
|
|
384
|
+
"""
|
|
385
|
+
if self.type != "UIToolkit":
|
|
386
|
+
raise exceptions.WrongAltObjectTypeException(
|
|
387
|
+
"This method is only available for VisualElement objects")
|
|
388
|
+
return commands.GetVisualElementProperty.run(self._connection, property_name, self,)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright(C)
|
|
2
|
+
Copyright(C) 2024 Altom Consulting
|
|
3
3
|
|
|
4
4
|
This program is free software: you can redistribute it and/or modify
|
|
5
5
|
it under the terms of the GNU General Public License as published by
|
|
@@ -22,7 +22,7 @@ from alttester.exceptions import InvalidParameterTypeException
|
|
|
22
22
|
|
|
23
23
|
class AddNotificationListener(BaseCommand):
|
|
24
24
|
|
|
25
|
-
def __init__(self, connection, notification_type, notification_callback, overwrite):
|
|
25
|
+
def __init__(self, connection, notification_type, notification_callback, overwrite=False):
|
|
26
26
|
super().__init__(connection, "activateNotification")
|
|
27
27
|
|
|
28
28
|
if notification_type not in NotificationType:
|
|
@@ -33,7 +33,7 @@ class AddNotificationListener(BaseCommand):
|
|
|
33
33
|
)
|
|
34
34
|
self.notification_type = notification_type
|
|
35
35
|
|
|
36
|
-
if
|
|
36
|
+
if not callable(notification_callback):
|
|
37
37
|
raise InvalidParameterTypeException(
|
|
38
38
|
parameter_name='notification_callback',
|
|
39
39
|
expected_types=[callable],
|
|
@@ -41,7 +41,7 @@ class AddNotificationListener(BaseCommand):
|
|
|
41
41
|
)
|
|
42
42
|
self.notification_callback = notification_callback
|
|
43
43
|
|
|
44
|
-
if
|
|
44
|
+
if not isinstance(overwrite, bool):
|
|
45
45
|
raise InvalidParameterTypeException(
|
|
46
46
|
parameter_name='overwrite',
|
|
47
47
|
expected_types=[bool],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright(C)
|
|
2
|
+
Copyright(C) 2024 Altom Consulting
|
|
3
3
|
|
|
4
4
|
This program is free software: you can redistribute it and/or modify
|
|
5
5
|
it under the terms of the GNU General Public License as published by
|
|
@@ -43,7 +43,8 @@ class RemoveNotificationListener(BaseCommand):
|
|
|
43
43
|
return parameters
|
|
44
44
|
|
|
45
45
|
def execute(self):
|
|
46
|
-
self.connection._notification_handler.remove_notification_listener(
|
|
46
|
+
self.connection._notification_handler.remove_notification_listener(
|
|
47
|
+
self.notification_type)
|
|
47
48
|
data = self.send()
|
|
48
49
|
self.validate_response("Ok", data)
|
|
49
50
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright(C)
|
|
2
|
+
Copyright(C) 2024 Altom Consulting
|
|
3
3
|
|
|
4
4
|
This program is free software: you can redistribute it and/or modify
|
|
5
5
|
it under the terms of the GNU General Public License as published by
|
|
@@ -31,6 +31,8 @@ class WaitForComponentProperty(Command):
|
|
|
31
31
|
altObject,
|
|
32
32
|
timeout=20,
|
|
33
33
|
interval=0.5,
|
|
34
|
+
get_property_as_string=False,
|
|
35
|
+
max_depth=2
|
|
34
36
|
):
|
|
35
37
|
self.component_name = component_name
|
|
36
38
|
self.property_name = property_name
|
|
@@ -38,6 +40,8 @@ class WaitForComponentProperty(Command):
|
|
|
38
40
|
self.assembly = assembly
|
|
39
41
|
self.timeout = timeout
|
|
40
42
|
self.interval = interval
|
|
43
|
+
self.get_property_as_string = get_property_as_string
|
|
44
|
+
self.max_depth = max_depth
|
|
41
45
|
self.altObject = altObject
|
|
42
46
|
|
|
43
47
|
def execute(self):
|
|
@@ -47,9 +51,12 @@ class WaitForComponentProperty(Command):
|
|
|
47
51
|
while t <= self.timeout:
|
|
48
52
|
try:
|
|
49
53
|
property_found = self.altObject.get_component_property(
|
|
50
|
-
self.component_name, self.property_name, self.assembly
|
|
54
|
+
self.component_name, self.property_name, self.assembly, max_depth=self.max_depth
|
|
51
55
|
)
|
|
52
|
-
if property_found == self.property_value:
|
|
56
|
+
if not self.get_property_as_string and property_found == self.property_value:
|
|
57
|
+
return property_found
|
|
58
|
+
if self.get_property_as_string and \
|
|
59
|
+
str(property_found).replace(" ", "") == str(self.property_value).replace(" ", ""):
|
|
53
60
|
return property_found
|
|
54
61
|
except Exception as ex:
|
|
55
62
|
exception = ex
|
{alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/FindObjects/wait_for_object.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright(C)
|
|
2
|
+
Copyright(C) 2024 Altom Consulting
|
|
3
3
|
|
|
4
4
|
This program is free software: you can redistribute it and/or modify
|
|
5
5
|
it under the terms of the GNU General Public License as published by
|
|
@@ -70,6 +70,7 @@ class WaitForObject(Command):
|
|
|
70
70
|
t += self.interval
|
|
71
71
|
|
|
72
72
|
if t >= self.timeout:
|
|
73
|
-
raise WaitTimeOutException(
|
|
73
|
+
raise WaitTimeOutException(
|
|
74
|
+
"Element {} not found after {} seconds".format(self.value, self.timeout))
|
|
74
75
|
|
|
75
76
|
return alt_object
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright(C)
|
|
2
|
+
Copyright(C) 2024 Altom Consulting
|
|
3
3
|
|
|
4
4
|
This program is free software: you can redistribute it and/or modify
|
|
5
5
|
it under the terms of the GNU General Public License as published by
|
|
@@ -57,7 +57,8 @@ class WaitForObjectToNotBePresent(Command):
|
|
|
57
57
|
|
|
58
58
|
while (t <= self.timeout):
|
|
59
59
|
try:
|
|
60
|
-
logger.debug(
|
|
60
|
+
logger.debug(
|
|
61
|
+
"Waiting for element {} to not be present...", self.value)
|
|
61
62
|
|
|
62
63
|
FindObject(
|
|
63
64
|
self.connection,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright(C)
|
|
2
|
+
Copyright(C) 2024 Altom Consulting
|
|
3
3
|
|
|
4
4
|
This program is free software: you can redistribute it and/or modify
|
|
5
5
|
it under the terms of the GNU General Public License as published by
|
|
@@ -65,7 +65,8 @@ class WaitForObjectWhichContains(Command):
|
|
|
65
65
|
|
|
66
66
|
break
|
|
67
67
|
except NotFoundException:
|
|
68
|
-
logger.debug(
|
|
68
|
+
logger.debug(
|
|
69
|
+
"Waiting for element where name contains {}...", self.value)
|
|
69
70
|
time.sleep(self.interval)
|
|
70
71
|
t += self.interval
|
|
71
72
|
|
{alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/keys_down.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright(C)
|
|
2
|
+
Copyright(C) 2024 Altom Consulting
|
|
3
3
|
|
|
4
4
|
This program is free software: you can redistribute it and/or modify
|
|
5
5
|
it under the terms of the GNU General Public License as published by
|
|
@@ -47,7 +47,7 @@ class KeysDown(BaseCommand):
|
|
|
47
47
|
def _parameters(self):
|
|
48
48
|
parameters = super()._parameters
|
|
49
49
|
parameters.update(**{
|
|
50
|
-
"keyCodes": [str(key_code) for key_code in self.key_codes],
|
|
50
|
+
"keyCodes": [str(key_code.value) for key_code in self.key_codes],
|
|
51
51
|
"power": self.power
|
|
52
52
|
})
|
|
53
53
|
|
{alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/keys_up.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright(C)
|
|
2
|
+
Copyright(C) 2024 Altom Consulting
|
|
3
3
|
|
|
4
4
|
This program is free software: you can redistribute it and/or modify
|
|
5
5
|
it under the terms of the GNU General Public License as published by
|
|
@@ -46,7 +46,7 @@ class KeysUp(BaseCommand):
|
|
|
46
46
|
def _parameters(self):
|
|
47
47
|
parameters = super()._parameters
|
|
48
48
|
parameters.update(**{
|
|
49
|
-
"keyCodes": [str(key_code) for key_code in self.key_codes],
|
|
49
|
+
"keyCodes": [str(key_code.value) for key_code in self.key_codes],
|
|
50
50
|
})
|
|
51
51
|
|
|
52
52
|
return parameters
|
{alttester_driver-2.1.1 → alttester_driver-2.2.0}/alttester/commands/InputActions/press_keys.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright(C)
|
|
2
|
+
Copyright(C) 2024 Altom Consulting
|
|
3
3
|
|
|
4
4
|
This program is free software: you can redistribute it and/or modify
|
|
5
5
|
it under the terms of the GNU General Public License as published by
|
|
@@ -49,7 +49,7 @@ class PressKeys(BaseCommand):
|
|
|
49
49
|
def _parameters(self):
|
|
50
50
|
parameters = super()._parameters
|
|
51
51
|
parameters.update(**{
|
|
52
|
-
"keyCodes": [str(key_code) for key_code in self.key_codes],
|
|
52
|
+
"keyCodes": [str(key_code.value) for key_code in self.key_codes],
|
|
53
53
|
"power": self.power,
|
|
54
54
|
"duration": self.duration,
|
|
55
55
|
"wait": self.wait,
|