Skip to content

Commit 673b50d

Browse files
committed
refactor: standardize parameter and variable naming conventions across multiple files
1 parent 7fbf4bb commit 673b50d

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

py/selenium/webdriver/remote/shadowroot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __repr__(self) -> str:
4545
def id(self) -> str:
4646
return self._id
4747

48-
def find_element(self, by: str = By.ID, value: str = None)-> WebElement:
48+
def find_element(self, by: str = By.ID, value: str = None) -> WebElement:
4949
"""Find an element inside a shadow root given a By strategy and
5050
locator.
5151
@@ -65,7 +65,7 @@ def find_element(self, by: str = By.ID, value: str = None)-> WebElement:
6565
The first matching `WebElement` found on the page.
6666
6767
Example:
68-
>>> element = driver.find_element(By.ID, 'foo')
68+
>>> element = driver.find_element(By.ID, "foo")
6969
"""
7070
if by == By.ID:
7171
by = By.CSS_SELECTOR
@@ -100,7 +100,7 @@ def find_elements(self, by: str = By.ID, value: str = None) -> list[WebElement]:
100100
List of `WebElements` matching locator strategy found on the page.
101101
102102
Example:
103-
>>> element = driver.find_elements(By.ID, 'foo')
103+
>>> element = driver.find_elements(By.ID, "foo")
104104
"""
105105
if by == By.ID:
106106
by = By.CSS_SELECTOR

py/selenium/webdriver/remote/webdriver.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,9 @@ def execute_script(self, script: str, *args):
504504
*args: Any applicable arguments for your JavaScript.
505505
506506
Example:
507-
>>> input_id = "username"
508-
>>> input_value = "test_user"
509-
>>> driver.execute_script("document.getElementById(arguments[0]).value = arguments[1];", input_id, input_value)
507+
>>> id = "username"
508+
>>> value = "test_user"
509+
>>> driver.execute_script("document.getElementById(arguments[0]).value = arguments[1];", id, value)
510510
"""
511511
if isinstance(script, ScriptKey):
512512
try:
@@ -1302,8 +1302,8 @@ def input(self):
13021302
13031303
Examples:
13041304
>>> from selenium.webdriver.common.bidi.input import KeySourceActions, KeyDownAction, KeyUpAction
1305-
>>> key_actions = KeySourceActions(id="keyboard", actions=[KeyDownAction(value="a"), KeyUpAction(value="a")])
1306-
>>> driver.input.perform_actions(driver.current_window_handle, [key_actions])
1305+
>>> actions = KeySourceActions(id="keyboard", actions=[KeyDownAction(value="a"), KeyUpAction(value="a")])
1306+
>>> driver.input.perform_actions(driver.current_window_handle, [actions])
13071307
>>> driver.input.release_actions(driver.current_window_handle)
13081308
"""
13091309
if not self._websocket_connection:

py/selenium/webdriver/remote/webelement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ def find_element(self, by=By.ID, value=None) -> WebElement:
531531
The first matching `WebElement` found on the page.
532532
533533
Example:
534-
>>> element = driver.find_element(By.ID, 'foo')
534+
>>> element = driver.find_element(By.ID, "foo")
535535
"""
536536
by, value = self._parent.locator_converter.convert(by, value)
537537
return self._execute(Command.FIND_CHILD_ELEMENT, {"using": by, "value": value})["value"]

py/selenium/webdriver/safari/options.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ class Options(ArgOptions):
6666
SAFARI_TECH_PREVIEW = "Safari Technology Preview"
6767

6868
# creating descriptor objects
69-
automatic_inspection : bool = _SafariOptionsDescriptor(AUTOMATIC_INSPECTION, bool)
69+
automatic_inspection: bool = _SafariOptionsDescriptor(AUTOMATIC_INSPECTION, bool)
7070
"""Whether to enable automatic inspection."""
7171

72-
automatic_profiling : bool = _SafariOptionsDescriptor(AUTOMATIC_PROFILING, bool)
72+
automatic_profiling: bool = _SafariOptionsDescriptor(AUTOMATIC_PROFILING, bool)
7373
"""Whether to enable automatic profiling."""
7474

75-
use_technology_preview : bool = _SafariOptionsDescriptor(SAFARI_TECH_PREVIEW, bool)
75+
use_technology_preview: bool = _SafariOptionsDescriptor(SAFARI_TECH_PREVIEW, bool)
7676
"""Whether to use Safari Technology Preview."""
7777

7878
@property

py/selenium/webdriver/support/expected_conditions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def staleness_of(element: WebElement) -> Callable[[Any], bool]:
558558
>>> from selenium.webdriver.common.by import By
559559
>>> from selenium.webdriver.support.ui import WebDriverWait
560560
>>> from selenium.webdriver.support import expected_conditions as EC
561-
>>> is_element_stale = WebDriverWait(driver, 10).until(EC.staleness_of(driver.find_element(By.CLASS_NAME, "foo")))
561+
>>> is_stale = WebDriverWait(driver, 10).until(EC.staleness_of(driver.find_element(By.CLASS_NAME, "foo")))
562562
"""
563563

564564
def _predicate(_):

0 commit comments

Comments
 (0)