File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import base64
22import os
3+ import warnings
34
45from datetime import datetime
56from os import path
1718from testui .support .configuration import Configuration
1819
1920
21+ def deprecated (message ):
22+ def decorator (func ):
23+ def wrapper (* args , ** kwargs ):
24+ warnings .warn (
25+ f"{ func .__name__ } is deprecated: { message } " ,
26+ category = DeprecationWarning ,
27+ stacklevel = 2
28+ )
29+ return func (* args , ** kwargs )
30+
31+ return wrapper
32+
33+ return decorator
34+
35+
2036class TestUIDriver :
2137 """
2238 This class is the main class for the TestUI framework. It is used to
@@ -120,6 +136,7 @@ def remove_log_file(self, when_no_errors=True):
120136 logger .log_debug ("Log file already removed" )
121137 return self
122138
139+ @deprecated ("This method is deprecated and will be removed in a future version. Use actions() instead" )
123140 def touch_actions (self ) -> TouchAction :
124141 """
125142 Deprecated function, soon to be removed, use actions instead.
@@ -212,12 +229,12 @@ def network_connection(self) -> int:
212229 return self .driver .network_connection
213230
214231 def find_image_match (
215- self ,
216- comparison ,
217- threshold = 0.90 ,
218- assertion = False ,
219- not_found = False ,
220- image_match = "" ,
232+ self ,
233+ comparison ,
234+ threshold = 0.90 ,
235+ assertion = False ,
236+ not_found = False ,
237+ image_match = "" ,
221238 ) -> bool :
222239 """
223240 Will find an image match based on the comparison type and threshold
@@ -476,13 +493,13 @@ def stop_recording_screen(self, file_name="testui-video.mp4"):
476493 return self
477494
478495 def stop_recording_and_compare (
479- self ,
480- comparison ,
481- threshold = 0.9 ,
482- fps_reduction = 1 ,
483- not_found = False ,
484- keep_image_as = "" ,
485- assertion = True ,
496+ self ,
497+ comparison ,
498+ threshold = 0.9 ,
499+ fps_reduction = 1 ,
500+ not_found = False ,
501+ keep_image_as = "" ,
502+ assertion = True ,
486503 ) -> bool :
487504 """
488505 Stop recording the screen and compare the video with the given image
You can’t perform that action at this time.
0 commit comments