Skip to content

Commit 5438565

Browse files
committed
Stub fixes
1 parent 09b7e2f commit 5438565

File tree

2 files changed

+45
-15
lines changed

2 files changed

+45
-15
lines changed

gen_stub.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,33 @@ def keyword_line(keyword_arguments, keyword_types, method_name):
106106
from datetime import timedelta
107107
from typing import Any, Optional, Union
108108
109+
from selenium.webdriver.remote.webdriver import WebDriver
110+
from selenium.webdriver.remote.webelement import WebElement
109111
110112
class SeleniumLibrary:
111113
"""
112114
pyi_boilerplate_append = """
113115
def add_library_components(self, library_components): ...
114116
def get_keyword_names(self): ...
115-
def run_keyword(self, name, args, kwargs=None): ...
116-
def get_keyword_arguments(self, name): ...
117-
def get_keyword_tags(self, name): ...
118-
def get_keyword_documentation(self, name): ...
119-
def get_keyword_types(self, name): ...
120-
def get_keyword_source(self, keyword_name): ...
121-
117+
def run_keyword(self, name: str, args: tuple, kwargs: Optional[dict] = None): ...
118+
def get_keyword_arguments(self, name: str): ...
119+
def get_keyword_tags(self, name: str): ...
120+
def get_keyword_documentation(self, name: str): ...
121+
def get_keyword_types(self, name: str): ...
122+
def get_keyword_source(self, keyword_name: str): ...
123+
def failure_occurred(self): ...
124+
def register_driver(self, driver: WebDriver, alias: str): ...
125+
@property
126+
def driver(self) -> WebDriver: ...
127+
def find_element(self, locator: str, parent: Optional[WebElement] = None): ...
128+
def find_elements(self, locator: str, parent: WebElement = None): ...
129+
def _parse_plugins(self, plugins: Any): ...
130+
def _parse_plugin_doc(self): ...
131+
def _get_intro_documentation(self): ...
132+
def _parse_listener(self, event_firing_webdriver: Any): ...
133+
def _string_to_modules(self, modules: Any): ...
134+
def _store_plugin_keywords(self, plugin): ...
135+
def _resolve_screenshot_root_directory(self): ...
122136
"""
123137

124138
INIT_METHOD = KeywordBuilder.build(SL.__init__)
@@ -130,5 +144,5 @@ def get_keyword_source(self, keyword_name): ...
130144
)
131145
)
132146
stub_file.writelines(FUNCTION_LIST)
133-
stub_file.write("\n # methods from PythonLibCore")
147+
stub_file.write("\n # methods from library.")
134148
stub_file.writelines(pyi_boilerplate_append.splitlines(keepends=True))

src/SeleniumLibrary/__init__.pyi

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
from datetime import timedelta
22
from typing import Any, Optional, Union
33

4+
from selenium.webdriver.remote.webdriver import WebDriver
5+
from selenium.webdriver.remote.webelement import WebElement
6+
47
class SeleniumLibrary:
58
def __init__(
69
self,
@@ -401,12 +404,25 @@ class SeleniumLibrary:
401404
error: Optional[str] = None,
402405
limit: Optional[int] = None,
403406
): ...
404-
# methods from PythonLibCore
407+
# methods from library.
405408
def add_library_components(self, library_components): ...
406409
def get_keyword_names(self): ...
407-
def run_keyword(self, name, args, kwargs=None): ...
408-
def get_keyword_arguments(self, name): ...
409-
def get_keyword_tags(self, name): ...
410-
def get_keyword_documentation(self, name): ...
411-
def get_keyword_types(self, name): ...
412-
def get_keyword_source(self, keyword_name): ...
410+
def run_keyword(self, name: str, args: tuple, kwargs: Optional[dict] = None): ...
411+
def get_keyword_arguments(self, name: str): ...
412+
def get_keyword_tags(self, name: str): ...
413+
def get_keyword_documentation(self, name: str): ...
414+
def get_keyword_types(self, name: str): ...
415+
def get_keyword_source(self, keyword_name: str): ...
416+
def failure_occurred(self): ...
417+
def register_driver(self, driver: WebDriver, alias: str): ...
418+
@property
419+
def driver(self) -> WebDriver: ...
420+
def find_element(self, locator: str, parent: Optional[WebElement] = None): ...
421+
def find_elements(self, locator: str, parent: WebElement = None): ...
422+
def _parse_plugins(self, plugins: Any): ...
423+
def _parse_plugin_doc(self): ...
424+
def _get_intro_documentation(self): ...
425+
def _parse_listener(self, event_firing_webdriver: Any): ...
426+
def _string_to_modules(self, modules: Any): ...
427+
def _store_plugin_keywords(self, plugin): ...
428+
def _resolve_screenshot_root_directory(self): ...

0 commit comments

Comments
 (0)