Exemple #1
0
    def __init__(self, driver, switch_to):
        # type: (EyesWebDriver, SwitchTo) -> None
        """
        Ctor.

        :param driver: EyesWebDriver instance.
        :param switch_to: Selenium switchTo object.
        """
        self._proxy_to_fields = all_attrs(switch_to)
        self._switch_to = switch_to  # type: SwitchTo
        self._driver = driver  # type: EyesWebDriver
    def __init__(self, element, driver):
        # type: (WebElement, EyesWebDriver) -> None
        """
        Ctor.

        :param element: The element in the frame.
        :param eyes: The eyes sdk instance.
        :param driver: EyesWebDriver instance.
        """
        if isinstance(element, EyesWebElement):
            element = element._element
        self._proxy_to_fields = all_attrs(element)
        self._element = element  # type: Union[WebElement, MobileWebElement]
        self._eyes_driver = driver  # type: EyesWebDriver

        # setting from outside
        self.position_provider = None  # type: Optional[SeleniumPositionProvider]
        self._original_overflow = None  # type: Optional[Text]
Exemple #3
0
    def __init__(self, driver, eyes):
        # type: (WebDriver, Eyes) -> None
        """
        Ctor.

        :param driver: remote WebDriver instance.
        :param eyes: A Eyes sdk instance.
        :param stitch_mode: How to stitch a page (default is with scrolling).
        """
        self._proxy_to_fields = all_attrs(driver)
        self._driver = driver  # type: Union[WebDriver, AppiumWebDriver]
        self._eyes = eyes  # type: Eyes
        # List of frames the user switched to, and the current offset,
        # so we can properly calculate elements' coordinates
        self._frame_chain = FrameChain()
        self._default_content_viewport_size = None  # type: Optional[ViewPort]

        self.driver_takes_screenshot = driver.capabilities.get("takesScreenshot", False)
        self.rotation = None  # type: Optional[int]
        self._user_agent = None  # type: Optional[UserAgent]
Exemple #4
0
 def __init__(self):
     self.some_obj = ProxyToObj()
     self._proxy_to_fields = all_attrs(self.some_obj)
     self.test_var = "test_var"
 def __init__(self):
     super(LastClass, self).__init__()
     self._proxy_to_fields = all_attrs(self.some_obj)
     self.test_var = "test_var"