21
21
22
22
import pkgutil
23
23
import sys
24
- from typing import (Dict , List ,
25
- NoReturn , Union )
24
+ from typing import Dict , List , Union
26
25
27
26
import warnings
28
27
@@ -318,7 +317,7 @@ def stop_client(self):
318
317
"""
319
318
pass
320
319
321
- def start_session (self , capabilities : dict , browser_profile = None ) -> NoReturn :
320
+ def start_session (self , capabilities : dict , browser_profile = None ) -> None :
322
321
"""
323
322
Creates a new session with the desired capabilities.
324
323
@@ -405,7 +404,7 @@ def execute(self, driver_command: str, params: dict = None) -> dict:
405
404
# a success
406
405
return {'success' : 0 , 'value' : None , 'sessionId' : self .session_id }
407
406
408
- def get (self , url : str ) -> NoReturn :
407
+ def get (self , url : str ) -> None :
409
408
"""
410
409
Loads a web page in the current browser session.
411
410
"""
@@ -753,7 +752,7 @@ def pin_script(self, script, script_key=None) -> ScriptKey:
753
752
self .pinned_scripts [_script_key .id ] = script
754
753
return _script_key
755
754
756
- def unpin (self , script_key ) -> NoReturn :
755
+ def unpin (self , script_key ) -> None :
757
756
"""
758
757
759
758
"""
@@ -837,7 +836,7 @@ def page_source(self) -> str:
837
836
"""
838
837
return self .execute (Command .GET_PAGE_SOURCE )['value' ]
839
838
840
- def close (self ) -> NoReturn :
839
+ def close (self ) -> None :
841
840
"""
842
841
Closes the current window.
843
842
@@ -848,7 +847,7 @@ def close(self) -> NoReturn:
848
847
"""
849
848
self .execute (Command .CLOSE )
850
849
851
- def quit (self ) -> NoReturn :
850
+ def quit (self ) -> None :
852
851
"""
853
852
Quits the driver and closes every associated window.
854
853
@@ -887,21 +886,21 @@ def window_handles(self) -> List[str]:
887
886
"""
888
887
return self .execute (Command .W3C_GET_WINDOW_HANDLES )['value' ]
889
888
890
- def maximize_window (self ) -> NoReturn :
889
+ def maximize_window (self ) -> None :
891
890
"""
892
891
Maximizes the current window that webdriver is using
893
892
"""
894
893
params = None
895
894
command = Command .W3C_MAXIMIZE_WINDOW
896
895
self .execute (command , params )
897
896
898
- def fullscreen_window (self ) -> NoReturn :
897
+ def fullscreen_window (self ) -> None :
899
898
"""
900
899
Invokes the window manager-specific 'full screen' operation
901
900
"""
902
901
self .execute (Command .FULLSCREEN_WINDOW )
903
902
904
- def minimize_window (self ) -> NoReturn :
903
+ def minimize_window (self ) -> None :
905
904
"""
906
905
Invokes the window manager-specific 'minimize' operation
907
906
"""
@@ -939,7 +938,7 @@ def switch_to(self) -> SwitchTo:
939
938
return self ._switch_to
940
939
941
940
# Navigation
942
- def back (self ) -> NoReturn :
941
+ def back (self ) -> None :
943
942
"""
944
943
Goes one step backward in the browser history.
945
944
@@ -950,7 +949,7 @@ def back(self) -> NoReturn:
950
949
"""
951
950
self .execute (Command .GO_BACK )
952
951
953
- def forward (self ) -> NoReturn :
952
+ def forward (self ) -> None :
954
953
"""
955
954
Goes one step forward in the browser history.
956
955
@@ -961,7 +960,7 @@ def forward(self) -> NoReturn:
961
960
"""
962
961
self .execute (Command .GO_FORWARD )
963
962
964
- def refresh (self ) -> NoReturn :
963
+ def refresh (self ) -> None :
965
964
"""
966
965
Refreshes the current page.
967
966
@@ -998,7 +997,7 @@ def get_cookie(self, name) -> dict:
998
997
except NoSuchCookieException :
999
998
return None
1000
999
1001
- def delete_cookie (self , name ) -> NoReturn :
1000
+ def delete_cookie (self , name ) -> None :
1002
1001
"""
1003
1002
Deletes a single cookie with the given name.
1004
1003
@@ -1009,7 +1008,7 @@ def delete_cookie(self, name) -> NoReturn:
1009
1008
"""
1010
1009
self .execute (Command .DELETE_COOKIE , {'name' : name })
1011
1010
1012
- def delete_all_cookies (self ) -> NoReturn :
1011
+ def delete_all_cookies (self ) -> None :
1013
1012
"""
1014
1013
Delete all cookies in the scope of the session.
1015
1014
@@ -1020,7 +1019,7 @@ def delete_all_cookies(self) -> NoReturn:
1020
1019
"""
1021
1020
self .execute (Command .DELETE_ALL_COOKIES )
1022
1021
1023
- def add_cookie (self , cookie_dict ) -> NoReturn :
1022
+ def add_cookie (self , cookie_dict ) -> None :
1024
1023
"""
1025
1024
Adds a cookie to your current session.
1026
1025
@@ -1042,7 +1041,7 @@ def add_cookie(self, cookie_dict) -> NoReturn:
1042
1041
self .execute (Command .ADD_COOKIE , {'cookie' : cookie_dict })
1043
1042
1044
1043
# Timeouts
1045
- def implicitly_wait (self , time_to_wait ) -> NoReturn :
1044
+ def implicitly_wait (self , time_to_wait ) -> None :
1046
1045
"""
1047
1046
Sets a sticky timeout to implicitly wait for an element to be found,
1048
1047
or a command to complete. This method only needs to be called one
@@ -1060,7 +1059,7 @@ def implicitly_wait(self, time_to_wait) -> NoReturn:
1060
1059
self .execute (Command .SET_TIMEOUTS , {
1061
1060
'implicit' : int (float (time_to_wait ) * 1000 )})
1062
1061
1063
- def set_script_timeout (self , time_to_wait ) -> NoReturn :
1062
+ def set_script_timeout (self , time_to_wait ) -> None :
1064
1063
"""
1065
1064
Set the amount of time that the script should wait during an
1066
1065
execute_async_script call before throwing an error.
@@ -1076,7 +1075,7 @@ def set_script_timeout(self, time_to_wait) -> NoReturn:
1076
1075
self .execute (Command .SET_TIMEOUTS , {
1077
1076
'script' : int (float (time_to_wait ) * 1000 )})
1078
1077
1079
- def set_page_load_timeout (self , time_to_wait ) -> NoReturn :
1078
+ def set_page_load_timeout (self , time_to_wait ) -> None :
1080
1079
"""
1081
1080
Set the amount of time to wait for a page load to complete
1082
1081
before throwing an error.
@@ -1114,7 +1113,7 @@ def timeouts(self) -> Timeouts:
1114
1113
return Timeouts (** timeouts )
1115
1114
1116
1115
@timeouts .setter
1117
- def timeouts (self , timeouts ) -> NoReturn :
1116
+ def timeouts (self , timeouts ) -> None :
1118
1117
"""
1119
1118
Set all timeouts for the session. This will override any previously
1120
1119
set timeouts.
0 commit comments