def edit_file(self, filename, dclick=True): """ Edit `filename` via double-click or context menu. """ self("files_tab").click() element = self.find_file(filename) chain = ActionChains(self.browser) if dclick: # This has had issues... for i in range(10): try: chain.double_click(element).perform() except StaleElementReferenceException: logging.warning("edit_file: StaleElementReferenceException") element = self.find_file(filename, 1) chain = ActionChains(self.browser) else: break else: chain.context_click(element).perform() self("file_edit").click() self.browser.switch_to_window("Code Editor") return EditorPage.verify(self.browser, self.port)
def edit_file(self, filename, dclick=True): """ Edit `filename` via double-click or context menu. """ self('files_tab').click() element = self.find_file(filename) chain = ActionChains(self.browser) if dclick: # This has had issues... for i in range(10): try: chain.double_click(element).perform() except StaleElementReferenceException: logging.warning('edit_file: StaleElementReferenceException') element = self.find_file(filename, 1) chain = ActionChains(self.browser) else: break else: chain.context_click(element).perform() self('file_edit').click() self.browser.switch_to_window('Code Editor') return EditorPage.verify(self.browser, self.port)
def open_editor(self): """ Open code editor. Returns :class:`EditorPage`. """ self("tools_menu").click() self("editor_button").click() self.browser.switch_to_window("Code Editor") return EditorPage.verify(self.browser, self.port)
def open_editor(self): """ Open code editor. Returns :class:`EditorPage`. """ self('tools_menu').click() self('editor_button').click() self.browser.switch_to_window('Code Editor') return EditorPage.verify(self.browser, self.port)