示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 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)