File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
py/selenium/webdriver/common/bidi Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,11 @@ class PointerParameters:
6363 pointer_type : str = PointerType .MOUSE
6464
6565 def __post_init__ (self ):
66+ """Validate the pointer type after dataclass initialization.
67+
68+ Raises:
69+ ValueError: If the pointer_type is not one of the valid types.
70+ """
6671 if self .pointer_type not in PointerType .VALID_TYPES :
6772 raise ValueError (f"Invalid pointer type: { self .pointer_type } . Must be one of { PointerType .VALID_TYPES } " )
6873
@@ -84,6 +89,11 @@ class PointerCommonProperties:
8489 azimuth_angle : float = 0.0
8590
8691 def __post_init__ (self ):
92+ """Validate pointer common properties after dataclass initialization.
93+
94+ Raises:
95+ ValueError: If any of the properties are outside their valid ranges.
96+ """
8797 if self .width < 1 :
8898 raise ValueError ("width must be at least 1" )
8999 if self .height < 1 :
@@ -309,6 +319,10 @@ class PointerSourceActions:
309319 )
310320
311321 def __post_init__ (self ):
322+ """Initialize default pointer parameters if not provided.
323+
324+ Sets default PointerParameters if none are specified during initialization.
325+ """
312326 if self .parameters is None :
313327 self .parameters = PointerParameters ()
314328
You can’t perform that action at this time.
0 commit comments