Skip to content

Commit 474d3b7

Browse files
committed
Fix formatting
1 parent 25124be commit 474d3b7

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

py/selenium/webdriver/remote/shadowroot.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
from typing import Optional
2121
from typing import Union
2222

23-
from .command import Command
24-
from .webelement import WebElement
2523
from ..common.by import By
2624
from ..common.by import ByType
2725
from ..support.relative_locator import RelativeBy
26+
from .command import Command
27+
from .webelement import WebElement
2828

2929

3030
class ShadowRoot:
@@ -45,8 +45,7 @@ def __repr__(self) -> str:
4545
type(self), self.session.session_id, self._id
4646
)
4747

48-
def find_element(self, by: Union[ByType, RelativeBy] = By.ID,
49-
value: Optional[str] = None) -> WebElement:
48+
def find_element(self, by: Union[ByType, RelativeBy] = By.ID, value: Optional[str] = None) -> WebElement:
5049
"""Find an element inside a shadow root given a By strategy and
5150
locator.
5251
@@ -83,11 +82,9 @@ def find_element(self, by: Union[ByType, RelativeBy] = By.ID,
8382
by = By.CSS_SELECTOR
8483
value = f'[name="{value}"]'
8584

86-
return self._execute(Command.FIND_ELEMENT_FROM_SHADOW_ROOT, {"using": by, "value": value})[
87-
"value"]
85+
return self._execute(Command.FIND_ELEMENT_FROM_SHADOW_ROOT, {"using": by, "value": value})["value"]
8886

89-
def find_elements(self, by: Union[ByType, RelativeBy] = By.ID, value: Optional[str] = None) -> \
90-
List[WebElement]:
87+
def find_elements(self, by: Union[ByType, RelativeBy] = By.ID, value: Optional[str] = None) -> List[WebElement]:
9188
"""Find elements inside a shadow root given a By strategy and locator.
9289
9390
Parameters:
@@ -123,8 +120,7 @@ def find_elements(self, by: Union[ByType, RelativeBy] = By.ID, value: Optional[s
123120
by = By.CSS_SELECTOR
124121
value = f'[name="{value}"]'
125122

126-
return self._execute(Command.FIND_ELEMENTS_FROM_SHADOW_ROOT, {"using": by, "value": value})[
127-
"value"]
123+
return self._execute(Command.FIND_ELEMENTS_FROM_SHADOW_ROOT, {"using": by, "value": value})["value"]
128124

129125
# Private Methods
130126
def _execute(self, command, params=None):

py/selenium/webdriver/support/expected_conditions.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def _predicate(driver: WebDriver):
144144

145145

146146
def visibility_of_element_located(
147-
locator: LocatorType
147+
locator: LocatorType,
148148
) -> Callable[[WebDriverOrWebElement], Union[Literal[False], WebElement]]:
149149
"""An expectation for checking that an element is present on the DOM of a
150150
page and visible. Visibility means that the element is not only displayed
@@ -211,7 +211,7 @@ def _predicate(driver: WebDriverOrWebElement):
211211

212212

213213
def visibility_of_all_elements_located(
214-
locator: LocatorType
214+
locator: LocatorType,
215215
) -> Callable[[WebDriverOrWebElement], Union[List[WebElement], Literal[False]]]:
216216
"""An expectation for checking that all elements are present on the DOM of
217217
a page and visible. Visibility means that the elements are not only
@@ -251,9 +251,7 @@ def _predicate(driver: WebDriverOrWebElement):
251251
return _predicate
252252

253253

254-
def text_to_be_present_in_element_value(
255-
locator: LocatorType, text_: str
256-
) -> Callable[[WebDriverOrWebElement], bool]:
254+
def text_to_be_present_in_element_value(locator: LocatorType, text_: str) -> Callable[[WebDriverOrWebElement], bool]:
257255
"""An expectation for checking if the given text is present in the
258256
element's value.
259257

0 commit comments

Comments
 (0)