def _assign_viewport_size(self): if self._viewport_size: logger.debug("Assigning viewport size {0}".format(self._viewport_size)) _viewport_size.set_viewport_size(self._driver, self._viewport_size) else: logger.debug("No viewport size given. Extracting the viewport size from the driver...") self._viewport_size = _viewport_size.get_viewport_size(self._driver) logger.debug("Viewport size {0}".format(self._viewport_size))
def get_default_content_viewport_size(self): """ Returns: The viewport size of the most outer frame. """ current_frames = self.get_frame_chain() # If we're inside a frame, then we should first switch to the most outer frame. self.switch_to.default_content() viewport_size = _viewport_size.get_viewport_size(self) self.switch_to.frames(current_frames) return viewport_size
def get_default_content_viewport_size(self): """ Returns: The viewport size of the most outer frame. """ current_frames = self.get_frame_chain() # If we're inside a frame, then we should first switch to the most outer frame. self.switch_to.default_content() viewport_size = _viewport_size.get_viewport_size(self) self.switch_to.frames(current_frames) return viewport_size
def _assign_viewport_size(self): # When setting the viewport size we need to be in the default content frame original_frame_chain = self._driver.get_frame_chain() self._driver.switch_to.default_content() try: if self._viewport_size: logger.debug("Assigning viewport size {0}".format(self._viewport_size)) _viewport_size.set_viewport_size(self._driver, self._viewport_size) else: logger.debug("No viewport size given. Extracting the viewport size from the driver...") self._viewport_size = _viewport_size.get_viewport_size(self._driver) logger.debug("Viewport size {0}".format(self._viewport_size)) except EyesError as e: # Going back to the frame we started at self._driver.switch_to.frames(original_frame_chain) raise TestFailedError('Failed to assign viewport size!')
def _assign_viewport_size(self): # When setting the viewport size we need to be in the default content frame original_frame_chain = self._driver.get_frame_chain() self._driver.switch_to.default_content() try: if self._viewport_size: logger.debug("Assigning viewport size {0}".format(self._viewport_size)) _viewport_size.set_viewport_size(self._driver, self._viewport_size) else: logger.debug("No viewport size given. Extracting the viewport size from the driver...") self._viewport_size = _viewport_size.get_viewport_size(self._driver) logger.debug("Viewport size {0}".format(self._viewport_size)) except EyesError as e: # Going back to the frame we started at self._driver.switch_to.frames(original_frame_chain) raise TestFailedError('Failed to assign viewport size!')
def get_viewport_size(self): """ Returns: The viewport size of the current frame. """ return _viewport_size.get_viewport_size(self)
def get_viewport_size(self): """ Returns: The viewport size of the current frame. """ return _viewport_size.get_viewport_size(self)