def editor_page(self, double_click=True): """ Return :class:`ComponentPage` for this component. """ chain = ActionChains(self.browser) if double_click: chain.double_click(self.root).perform() else: chain.context_click(self.root).perform() self('edit_button').click() editor_id = 'CE-%s' % self.pathname.replace('.', '-') return ComponentPage(self.browser, self.port, (By.ID, editor_id))
def editor_page(self, double_click=True, base_type='Component'): """ Return :class:`ComponentPage` for this component. """ chain = ActionChains(self.browser) if double_click: chain.double_click(self.root).perform() else: self._context_click('edit_button') editor_id = 'CE-%s' % self.pathname.replace('.', '-') if base_type == 'Assembly': return AssemblyPage(self.browser, self.port, (By.ID, editor_id)) elif base_type == 'Driver': return DriverPage(self.browser, self.port, (By.ID, editor_id)) else: return ComponentPage(self.browser, self.port, (By.ID, editor_id))
def editor_page(self): """ Return :class:`ComponentPage` for this component. """ for retry in range(3): try: chain = ActionChains(self.browser) chain.double_click(self.slot).perform() except StaleElementReferenceException: if retry < 2: logging.warning('StaleElementReferenceException' ' in SlotFigure.editor_page()') else: raise else: break editor_id = 'CE-%s' % self.pathname.replace('.', '-') return ComponentPage(self.browser, self.port, (By.ID, editor_id))
def editor_page(self, double_click=True): """ Return :class:`ComponentPage` for this component. """ for retry in range(3): try: chain = ActionChains(self.browser) if double_click: chain.double_click(self.root).perform() else: self._context_click('edit_button') chain.release(None).perform() except StaleElementReferenceException: if retry < 2: logging.warning('StaleElementReferenceException' ' in SlotFigure.editor_page()') else: raise else: break editor_id = 'ObjectFrame_%s' % self.pathname.replace('.', '-') return ComponentPage(self.browser, self.port, (By.ID, editor_id))
def editor_page(self, double_click=True, base_type='Component', version=ComponentPage.Version.OLD): """ Return :class:`ComponentPage` for this component. """ chain = ActionChains(self.browser) if double_click: chain.double_click(self.root).perform() else: self._context_click('edit_button') editor_id = 'ObjectFrame_%s' % self.pathname.replace('.', '-') chain.release(None).perform() if base_type == 'Assembly': return AssemblyPage(self.browser, self.port, (By.ID, editor_id)) elif base_type == 'Driver': return DriverPage(self.browser, self.port, (By.ID, editor_id)) elif base_type == 'ImplicitComponent': return ImplicitComponentPage(self.browser, self.port, (By.ID, editor_id), version=version) else: return ComponentPage(self.browser, self.port, (By.ID, editor_id), version=version)
def edit(self, offset=15): """ Edit this component. """ self._context_click('edit_button', offset) editor_id = 'ObjectFrame_%s' % self.pathname.replace('.', '-') return ComponentPage(self.browser, self.port, (By.ID, editor_id))