Skip to content

Commit 20d02f1

Browse files
committed
Refactor docstrings for clarity and conciseness across multiple files
1 parent 62c5aa1 commit 20d02f1

File tree

11 files changed

+116
-114
lines changed

11 files changed

+116
-114
lines changed

py/selenium/webdriver/remote/errorhandler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ class ErrorHandler:
143143
"""Handles errors returned by the WebDriver server."""
144144

145145
def check_response(self, response: dict[str, Any]) -> None:
146-
"""Checks that a JSON response from the WebDriver does not have an
147-
error.
146+
"""Check that a JSON response from the WebDriver does not have an error.
148147
149148
Args:
150149
response: The JSON response from the WebDriver server as a dictionary

py/selenium/webdriver/remote/file_detector.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525

2626

2727
class FileDetector(metaclass=ABCMeta):
28-
"""Used for identifying whether a sequence of chars represents the path to
29-
a file.
30-
"""
28+
"""Identify whether a sequence of characters represents a file path."""
3129

3230
@abstractmethod
3331
def is_local_file(self, *keys: AnyKey) -> Optional[str]:

py/selenium/webdriver/remote/remote_connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ def get_certificate_bundle_path(cls):
224224

225225
@classmethod
226226
def set_certificate_bundle_path(cls, path):
227-
"""Set the path to the certificate bundle to verify connection to
228-
command executor. Can also be set to None to disable certificate
229-
validation.
227+
"""Set the path to the certificate bundle for verifying command executor connection.
228+
229+
Can also be set to None to disable certificate validation.
230230
231231
Args:
232232
path: path of a .pem encoded certificate chain.

py/selenium/webdriver/remote/shadowroot.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ def id(self) -> str:
4545
return self._id
4646

4747
def find_element(self, by: str = By.ID, value: str = None):
48-
"""Find an element inside a shadow root given a By strategy and
49-
locator.
48+
"""Find an element inside a shadow root given a By strategy and locator.
5049
5150
Args:
5251
by: The locating strategy to use. Default is `By.ID`. Supported values include:

py/selenium/webdriver/remote/switch_to.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,11 @@ def default_content(self) -> None:
5959
self._driver.execute(Command.SWITCH_TO_FRAME, {"id": None})
6060

6161
def frame(self, frame_reference: Union[str, int, WebElement]) -> None:
62-
"""Switches focus to the specified frame, by index, name, or
63-
webelement.
62+
"""Switch focus to the specified frame by index, name, or element.
6463
6564
Args:
66-
frame_reference: The name of the window to switch to, an integer representing the index,
67-
or a webelement that is an (i)frame to switch to.
65+
frame_reference: The name of the frame to switch to, an integer representing the index,
66+
or a WebElement that is an (i)frame to switch to.
6867
6968
Example:
7069
driver.switch_to.frame("frame_name")
@@ -95,8 +94,9 @@ def new_window(self, type_hint: Optional[str] = None) -> None:
9594
self._w3c_window(value["handle"])
9695

9796
def parent_frame(self) -> None:
98-
"""Switches focus to the parent context. If the current context is the
99-
top level browsing context, the context remains unchanged.
97+
"""Switch focus to the parent browsing context.
98+
99+
If the current context is already the top level browsing context, it remains unchanged.
100100
101101
Example:
102102
driver.switch_to.parent_frame()

0 commit comments

Comments
 (0)