Skip to content

Commit 22b9dd2

Browse files
committed
Additional changes for cascading locators
- Fixed a couple incorrectly modified type hints on click button and click image - Added type hints to get webelement(s) keywords
1 parent 00f7f17 commit 22b9dd2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/SeleniumLibrary/keywords/element.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
class ElementKeywords(LibraryComponent):
3131
@keyword(name="Get WebElement")
32-
def get_webelement(self, locator: Union[WebElement, str]) -> WebElement:
32+
def get_webelement(self, locator: Union[WebElement, str, List[Union[WebElement,str]]]) -> WebElement:
3333
"""Returns the first WebElement matching the given ``locator``.
3434
3535
See the `Locating elements` section for details about the locator
@@ -38,7 +38,7 @@ def get_webelement(self, locator: Union[WebElement, str]) -> WebElement:
3838
return self.find_element(locator)
3939

4040
@keyword(name="Get WebElements")
41-
def get_webelements(self, locator: Union[WebElement, str]) -> List[WebElement]:
41+
def get_webelements(self, locator: Union[WebElement, str, List[Union[WebElement,str]]]) -> List[WebElement]:
4242
"""Returns a list of WebElement objects matching the ``locator``.
4343
4444
See the `Locating elements` section for details about the locator
@@ -582,7 +582,7 @@ def get_vertical_position(self, locator: Union[WebElement, str, List[Union[WebEl
582582

583583
@keyword
584584
def click_button(
585-
self, locator: Union[WebElement, str], modifier: Union[bool, str, List[Union[WebElement,str]]] = False
585+
self, locator: Union[WebElement, str, List[Union[WebElement,str]]], modifier: Union[bool, str] = False
586586
):
587587
"""Clicks the button identified by ``locator``.
588588
@@ -606,7 +606,7 @@ def click_button(
606606

607607
@keyword
608608
def click_image(
609-
self, locator: Union[WebElement, str], modifier: Union[bool, str, List[Union[WebElement,str]]] = False
609+
self, locator: Union[WebElement, str, List[Union[WebElement,str]]], modifier: Union[bool, str] = False
610610
):
611611
"""Clicks an image identified by ``locator``.
612612

0 commit comments

Comments
 (0)