Skip to content

Commit dca861c

Browse files
committed
add doc
1 parent b5b5be6 commit dca861c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

appium/protocols/webdriver/can_find_elements.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,21 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import TYPE_CHECKING, Dict, List, Protocol, Union
15+
from typing import TYPE_CHECKING, Dict, List, Protocol, Union, runtime_checkable
1616

1717
if TYPE_CHECKING:
1818
from appium.webdriver.webelement import WebElement
1919

2020

21+
@runtime_checkable
2122
class CanFindElements(Protocol):
23+
"""Protocol for objects that can find web elements.
24+
25+
Any class implementing this protocol must provide:
26+
- find_element(by, value): Find a single element
27+
- find_elements(by, value): Find multiple elements
28+
"""
29+
2230
def find_element(self, by: str, value: Union[str, Dict, None] = None) -> 'WebElement': ...
2331

2432
def find_elements(self, by: str, value: Union[str, Dict, None] = None) -> List['WebElement']: ...

0 commit comments

Comments
 (0)