@@ -96,36 +96,22 @@ def click(
9696 ):
9797 driver .mouseClick (
9898 self .object ,
99- x or self .width // 2 ,
100- y or self .height // 2 ,
99+ x or int ( self .object . width * 0.1 ) ,
100+ y or int ( self .object . height * 0.1 ) ,
101101 button or driver .Qt .LeftButton
102102 )
103- LOG .info ('%s: clicked' , self )
103+ LOG .info ('%s: is clicked with Qt.LeftButton ' , self )
104104
105105 @allure .step ('Native click {0}' )
106- def native_click (
106+ def native_mouse_click (
107107 self ,
108108 x : typing .Union [int , driver .UiTypes .ScreenPoint ] = None ,
109109 y : typing .Union [int , driver .UiTypes .ScreenPoint ] = None ,
110110 button : driver .MouseButton = None
111111 ):
112112 driver .nativeMouseClick (
113- x or self .bounds .x + self .width // 2 ,
114- y or self .bounds .y + self .height // 2 ,
115- button or driver .MouseButton .LeftButton
116- )
117- LOG .info (f'{ self } : native clicked' )
118-
119- @allure .step ('Native click {0}' )
120- def native_click (
121- self ,
122- x : typing .Union [int , driver .UiTypes .ScreenPoint ] = None ,
123- y : typing .Union [int , driver .UiTypes .ScreenPoint ] = None ,
124- button : driver .MouseButton = None
125- ):
126- driver .nativeMouseClick (
127- x or self .bounds .x + self .width // 2 ,
128- y or self .bounds .y + self .height // 2 ,
113+ x or int (self .bounds .x + self .width // 2 ),
114+ y or int (self .bounds .y + self .height // 2 ),
129115 button or driver .MouseButton .LeftButton
130116 )
131117 LOG .info (f'{ self } : native clicked' )
@@ -145,18 +131,18 @@ def _hover():
145131 assert driver .waitFor (lambda : _hover (), timeout_msec )
146132 return self
147133
148- @allure .step ('Open context menu ' )
149- def open_context_menu (
134+ @allure .step ('Right click on {0} ' )
135+ def right_click (
150136 self ,
151137 x : typing .Union [int , driver .UiTypes .ScreenPoint ] = None ,
152138 y : typing .Union [int , driver .UiTypes .ScreenPoint ] = None ,
153139 ):
154140 self .click (
155- x or self .width // 2 ,
156- y or self .height // 2 ,
141+ x or int ( self .width // 2 ) ,
142+ y or int ( self .height // 2 ) ,
157143 driver .Qt .RightButton
158144 )
159- LOG .info ('%s: clicked via Right Mouse Button ' , self )
145+ LOG .info ('%s: right clicked with Qt.RightButton ' , self )
160146
161147 @allure .step ('Wait until appears {0}' )
162148 def wait_until_appears (self , timeout_msec : int = configs .timeouts .UI_LOAD_TIMEOUT_MSEC ):
0 commit comments