15
15
# specific language governing permissions and limitations
16
16
# under the License.
17
17
18
-
19
18
from typing import TYPE_CHECKING
20
19
21
20
if TYPE_CHECKING :
@@ -38,13 +37,13 @@ class JSONTimeouts(TypedDict, total=False):
38
37
39
38
40
39
class _TimeoutsDescriptor :
41
- """TimeoutsDescriptor which gets and sets value of below attributes:
40
+ """Get or set the value of the attributes listed below.
42
41
43
- _implicit _timeout
42
+ _implicit_wait
44
43
_page_load
45
44
_script
46
45
47
- This does not set the value on the remote end
46
+ This does not set the value on the remote end.
48
47
"""
49
48
50
49
def __init__ (self , name ):
@@ -60,40 +59,46 @@ def __set__(self, obj, value) -> None:
60
59
61
60
class Timeouts :
62
61
def __init__ (self , implicit_wait : float = 0 , page_load : float = 0 , script : float = 0 ) -> None :
63
- """Create a new Timeout object.
62
+ """Create a new Timeouts object.
63
+
64
+ This implements https://w3c.github.io/webdriver/#timeouts.
64
65
65
66
:Args:
66
- - implicit_wait - Either an int or a float. The number passed in needs to how many
67
- seconds the driver will wait.
68
- - page_load - Either an int or a float. The number passed in needs to how many
69
- seconds the driver will wait.
70
- - script - Either an int or a float. The number passed in needs to how many
71
- seconds the driver will wait.
67
+ - implicit_wait - Either an int or a float. Set how many
68
+ seconds to wait when searching for elements before
69
+ throwing an error.
70
+ - page_load - Either an int or a float. Set how many seconds
71
+ to wait for a page load to complete before throwing
72
+ an error.
73
+ - script - Either an int or a float. Set how many seconds to
74
+ wait for an asynchronous script to finish execution
75
+ before throwing an error.
72
76
"""
77
+
73
78
self .implicit_wait = implicit_wait
74
79
self .page_load = page_load
75
80
self .script = script
76
81
77
82
# Creating descriptor objects
78
83
implicit_wait = _TimeoutsDescriptor ("_implicit_wait" )
79
- """Sets and Gets the value of the implicit_timeout:
84
+ """Get or set how many seconds to wait when searching for elements.
80
85
81
86
This does not set the value on the remote end.
82
87
83
88
Usage
84
89
-----
85
90
- Get
86
- - `self.implicit_timeout `
91
+ - `self.implicit_wait `
87
92
- Set
88
- - `self.implicit_timeout ` = `value`
93
+ - `self.implicit_wait ` = `value`
89
94
90
95
Parameters
91
96
----------
92
97
`value`: `float`
93
98
"""
94
99
95
100
page_load = _TimeoutsDescriptor ("_page_load" )
96
- """Sets and Gets the value of page load wait:
101
+ """Get or set how many seconds to wait for the page to load.
97
102
98
103
This does not set the value on the remote end.
99
104
@@ -110,7 +115,7 @@ def __init__(self, implicit_wait: float = 0, page_load: float = 0, script: float
110
115
"""
111
116
112
117
script = _TimeoutsDescriptor ("_script" )
113
- """Sets and Gets the value of script wait:
118
+ """Get or set how many seconds to wait for an asynchronous script to finish execution.
114
119
115
120
This does not set the value on the remote end.
116
121
0 commit comments