diff --git a/py/pyproject.toml b/py/pyproject.toml index 97b689585eec4..3e9d15fc728b2 100644 --- a/py/pyproject.toml +++ b/py/pyproject.toml @@ -158,7 +158,6 @@ extend-ignore = [ "D205", # 1 blank line required between summary line and description "D212", # Multi-line docstring summary should start at the first line "D415", # First line should end with a period, question mark, or exclamation point - "D417", # Missing argument descriptions in the docstring for `__init__` ] [tool.ruff.format] diff --git a/py/selenium/webdriver/common/action_chains.py b/py/selenium/webdriver/common/action_chains.py index 885546b84edb6..a326bea402e5f 100644 --- a/py/selenium/webdriver/common/action_chains.py +++ b/py/selenium/webdriver/common/action_chains.py @@ -72,6 +72,8 @@ def __init__(self, driver: WebDriver, duration: int = 250, devices: list[AnyDevi Args: driver: The WebDriver instance which performs user actions. duration: override the default 250 msecs of DEFAULT_MOVE_DURATION in PointerInput + devices: Optional list of input devices (PointerInput, KeyInput, WheelInput) to use. + If not provided, default devices will be created. """ self._driver = driver mouse = None diff --git a/py/selenium/webdriver/common/actions/pointer_actions.py b/py/selenium/webdriver/common/actions/pointer_actions.py index 9be97f46345de..28186f767d9d8 100644 --- a/py/selenium/webdriver/common/actions/pointer_actions.py +++ b/py/selenium/webdriver/common/actions/pointer_actions.py @@ -25,10 +25,13 @@ class PointerActions(Interaction): def __init__(self, source: Optional[PointerInput] = None, duration: int = 250): - """ + """Initialize a new PointerActions instance. + Args: - - source: PointerInput instance - - duration: override the default 250 msecs of DEFAULT_MOVE_DURATION in source + source: Optional PointerInput instance. If not provided, a default + mouse PointerInput will be created. + duration: Override the default 250 msecs of DEFAULT_MOVE_DURATION + in the source. """ if source is None: source = PointerInput(interaction.POINTER_MOUSE, "mouse") diff --git a/py/selenium/webdriver/ie/service.py b/py/selenium/webdriver/ie/service.py index 61932c9668509..3627c4a4cb372 100644 --- a/py/selenium/webdriver/ie/service.py +++ b/py/selenium/webdriver/ie/service.py @@ -48,6 +48,7 @@ def __init__( log_output: (Optional) int representation of STDOUT/DEVNULL, any IO instance or String path to file. Default is "stdout". driver_path_env_key: (Optional) Environment variable to use to get the path to the driver executable. + **kwargs: Additional keyword arguments to pass to the parent Service class. """ self._service_args = list(service_args or []) driver_path_env_key = driver_path_env_key or "SE_IEDRIVER" diff --git a/py/selenium/webdriver/remote/shadowroot.py b/py/selenium/webdriver/remote/shadowroot.py index 16e33796a4e95..61c92797e05ed 100644 --- a/py/selenium/webdriver/remote/shadowroot.py +++ b/py/selenium/webdriver/remote/shadowroot.py @@ -59,6 +59,7 @@ def find_element(self, by: str = By.ID, value: str = None): - By.LINK_TEXT: Locate a link element by its exact text. - By.PARTIAL_LINK_TEXT: Locate a link element by partial text match. - RelativeBy: Locate elements relative to a specified root element. + value: The locator value to use with the specified `by` strategy. Returns: The first matching `WebElement` found on the page. @@ -94,6 +95,7 @@ def find_elements(self, by: str = By.ID, value: str = None) -> list: - By.LINK_TEXT: Locate a link element by its exact text. - By.PARTIAL_LINK_TEXT: Locate a link element by partial text match. - RelativeBy: Locate elements relative to a specified root element. + value: The locator value to use with the specified `by` strategy. Returns: List of `WebElements` matching locator strategy found on the page. diff --git a/py/selenium/webdriver/remote/webdriver.py b/py/selenium/webdriver/remote/webdriver.py index 17c7ac142f5fb..2b04e15a5709b 100644 --- a/py/selenium/webdriver/remote/webdriver.py +++ b/py/selenium/webdriver/remote/webdriver.py @@ -822,6 +822,7 @@ def find_element(self, by=By.ID, value: Optional[str] = None) -> WebElement: values include: By.ID, By.NAME, By.XPATH, By.CSS_SELECTOR, By.CLASS_NAME, By.TAG_NAME, By.LINK_TEXT, By.PARTIAL_LINK_TEXT, or RelativeBy. + value: The locator value to use with the specified `by` strategy. Returns: The first matching WebElement found on the page. @@ -847,6 +848,7 @@ def find_elements(self, by=By.ID, value: Optional[str] = None) -> list[WebElemen values include: By.ID, By.NAME, By.XPATH, By.CSS_SELECTOR, By.CLASS_NAME, By.TAG_NAME, By.LINK_TEXT, By.PARTIAL_LINK_TEXT, or RelativeBy. + value: The locator value to use with the specified `by` strategy. Returns: List of WebElements matching locator strategy found on the page. @@ -943,6 +945,7 @@ def set_window_size(self, width, height, windowHandle: str = "current") -> None: Args: width: The width in pixels to set the window to. height: The height in pixels to set the window to. + windowHandle: The handle of the window to resize. Default is "current". Example: >>> driver.set_window_size(800, 600) @@ -970,6 +973,7 @@ def set_window_position(self, x: float, y: float, windowHandle: str = "current") Args: x: The x-coordinate in pixels to set the window position. y: The y-coordinate in pixels to set the window position. + windowHandle: The handle of the window to reposition. Default is "current". Example: >>> driver.set_window_position(0, 0) diff --git a/py/selenium/webdriver/remote/webelement.py b/py/selenium/webdriver/remote/webelement.py index c90b48446660a..61977e58a7591 100644 --- a/py/selenium/webdriver/remote/webelement.py +++ b/py/selenium/webdriver/remote/webelement.py @@ -524,6 +524,7 @@ def find_element(self, by=By.ID, value=None) -> WebElement: - By.LINK_TEXT: Locate a link element by its exact text. - By.PARTIAL_LINK_TEXT: Locate a link element by partial text match. - RelativeBy: Locate elements relative to a specified root element. + value: The locator value to use with the specified `by` strategy. Returns: The first matching `WebElement` found on the page. @@ -548,6 +549,7 @@ def find_elements(self, by=By.ID, value=None) -> list[WebElement]: - By.LINK_TEXT: Locate a link element by its exact text. - By.PARTIAL_LINK_TEXT: Locate a link element by partial text match. - RelativeBy: Locate elements relative to a specified root element. + value: The locator value to use with the specified `by` strategy. Returns: List of `WebElements` matching locator strategy found on the page.