Added stubs for 2.7 Selenium WebElement

* Added stubs for 2.7 Selenium WebElement

* Removed silly autogenerated imports

* Added List import

* Added WebDriver as well

* Updated webdriver stubs for find*
This commit is contained in:
Max Wittek
2016-04-07 17:48:04 -07:00
committed by Guido van Rossum
parent dca8eeb1fe
commit a6f1075055
2 changed files with 176 additions and 0 deletions

View File

@@ -0,0 +1,111 @@
# Stubs for selenium.webdriver.remote.webdriver (Python 2)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Dict, List
from .mobile import Mobile as Mobile
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.remote.errorhandler import ErrorHandler
from selenium.webdriver.remote.file_detector import FileDetector
Capabilities = Dict[basestring, Any]
ExecuteResult = Dict[basestring, Any] # containing 'success', 'value', 'sessionId'
class WebDriver:
command_executor = ... # type: basestring
session_id = ... # type: Any
capabilities = ... # type: Capabilities
error_handler = ... # type: ErrorHandler
file_detector = ... # type: FileDetector
def __init__(self,
command_executor: basestring='',
desired_capabilities: Capabilities=None,
browser_profile=None,
proxy=None,
keep_alive:bool=False
) -> None: ...
@property
def mobile(self) -> Mobile: ...
@property
def name(self) -> basestring: ...
def start_client(self): ...
def stop_client(self): ...
w3c = ... # type: Any
def start_session(self, desired_capabilities, browser_profile=None): ...
def create_web_element(self, element_id: basestring) -> WebElement: ...
def execute(self, driver_command: basestring, params: Optional[Dict[basestring, Any]]=None) -> ExecuteResult: ...
def get(self, url: basestring) -> None: ...
@property
def title(self) -> basestring: ...
def find_element_by_id(self, id_: basestring) -> WebElement: ...
def find_elements_by_id(self, id_: basestring) -> List[WebElement]: ...
def find_element_by_xpath(self, xpath: basestring) -> WebElement: ...
def find_elements_by_xpath(self, xpath: basestring) -> List[WebElement]: ...
def find_element_by_link_text(self, link_text: basestring) -> WebElement: ...
def find_elements_by_link_text(self, text: basestring) -> List[WebElement]: ...
def find_element_by_partial_link_text(self, link_text: basestring) -> WebElement: ...
def find_elements_by_partial_link_text(self, link_text: basestring) -> List[WebElement]: ...
def find_element_by_name(self, name: basestring) -> WebElement: ...
def find_elements_by_name(self, name: basestring) -> List[WebElement]: ...
def find_element_by_tag_name(self, name: basestring) -> WebElement: ...
def find_elements_by_tag_name(self, name: basestring) -> List[WebElement]: ...
def find_element_by_class_name(self, name: basestring) -> WebElement: ...
def find_elements_by_class_name(self, name: basestring) -> List[WebElement]: ...
def find_element_by_css_selector(self, css_selector: basestring) -> WebElement: ...
def find_elements_by_css_selector(self, css_selector: basestring) -> List[WebElement]: ...
def execute_script(self, script, *args): ...
def execute_async_script(self, script, *args): ...
@property
def current_url(self) -> basestring: ...
@property
def page_source(self): ...
def close(self): ...
def quit(self): ...
@property
def current_window_handle(self): ...
@property
def window_handles(self): ...
def maximize_window(self): ...
@property
def switch_to(self): ...
def switch_to_active_element(self): ...
def switch_to_window(self, window_name): ...
def switch_to_frame(self, frame_reference): ...
def switch_to_default_content(self): ...
def switch_to_alert(self): ...
def back(self): ...
def forward(self): ...
def refresh(self): ...
def get_cookies(self): ...
def get_cookie(self, name): ...
def delete_cookie(self, name): ...
def delete_all_cookies(self): ...
def add_cookie(self, cookie_dict): ...
def implicitly_wait(self, time_to_wait): ...
def set_script_timeout(self, time_to_wait): ...
def set_page_load_timeout(self, time_to_wait): ...
def find_element(self, by=..., value=None): ...
def find_elements(self, by=..., value=None): ...
@property
def desired_capabilities(self): ...
def get_screenshot_as_file(self, filename): ...
save_screenshot = ... # type: Any
def get_screenshot_as_png(self): ...
def get_screenshot_as_base64(self): ...
def set_window_size(self, width, height, windowHandle=''): ...
def get_window_size(self, windowHandle=''): ...
def set_window_position(self, x, y, windowHandle=''): ...
def get_window_position(self, windowHandle=''): ...
@property
def file_detector(self): ...
@file_detector.setter
def file_detector(self, detector): ...
@property
def orientation(self): ...
@orientation.setter
def orientation(self, value): ...
@property
def application_cache(self): ...
@property
def log_types(self): ...
def get_log(self, log_type): ...

View File

@@ -0,0 +1,65 @@
# Stubs for selenium.webdriver.remote.webelement (Python 2)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from selenium.webdriver.remote.webdriver import WebDriver
from typing import Any, Optional, Dict, List
SizeDict = Dict[str, int] # containing "height", "width"
PointDict = Dict[str, int] # containing "x", "y"
class WebElement:
def __init__(self, parent: WebDriver, id_: Optional[basestring], w3c: bool=False) -> None: ...
@property
def tag_name(self) -> basestring: ...
@property
def text(self) -> Optional[basestring]: ...
def click(self) -> None: ...
def submit(self) -> None: ...
def clear(self) -> None: ...
def get_attribute(self, name: basestring) -> Optional[basestring]: ...
def is_selected(self) -> bool: ...
def is_enabled(self) -> bool: ...
def find_element_by_id(self, id_: basestring) -> WebElement: ...
def find_elements_by_id(self, id_: basestring) -> List[WebElement]: ...
def find_element_by_name(self, name: basestring) -> WebElement: ...
def find_elements_by_name(self, name: basestring) -> List[WebElement]: ...
def find_element_by_link_text(self, link_text: basestring) -> WebElement: ...
def find_elements_by_link_text(self, link_text: basestring) -> List[WebElement]: ...
def find_element_by_partial_link_text(self, link_text: basestring) -> WebElement: ...
def find_elements_by_partial_link_text(self, link_text: basestring) -> List[WebElement]: ...
def find_element_by_tag_name(self, name: basestring) -> WebElement: ...
def find_elements_by_tag_name(self, name: basestring) -> List[WebElement]: ...
def find_element_by_xpath(self, xpath: basestring) -> WebElement: ...
def find_elements_by_xpath(self, xpath: basestring) -> List[WebElement]: ...
def find_element_by_class_name(self, name: basestring) -> WebElement: ...
def find_elements_by_class_name(self, name: basestring) -> List[WebElement]: ...
def find_element_by_css_selector(self, css_selector: basestring) -> WebElement: ...
def find_elements_by_css_selector(self, css_selector: basestring) -> List[WebElement]: ...
def send_keys(self, *value: *basestring) -> None: ...
def is_displayed(self) -> bool: ...
@property
def location_once_scrolled_into_view(self): ...
@property
def size(self) -> SizeDict: ...
def value_of_css_property(self, property_name): ...
@property
def location(self) -> PointDict: ...
@property
def rect(self): ...
@property
def screenshot_as_base64(self): ...
@property
def screenshot_as_png(self): ...
def screenshot(self, filename: basestring): ...
@property
def parent(self) -> WebDriver: ...
@property
def id(self) -> Optional[basestring]: ...
def __eq__(self, element: object) -> bool: ...
def __ne__(self, element: object) -> bool: ...
def find_element(self, by: basestring=..., value: basestring=None) -> WebElement: ...
def find_elements(self, by: basestring=..., value: basestring=None) -> List[WebElement]: ...
def __hash__(self) -> int: ...