Ejemplo n.º 1
0
    def menu_item_enabled(self, window_name, menu_item):
        """
        [关键字概要] Verify whether a menu is enabled or not

        :param window_name: 窗口名称

        :param menu_item: 菜单名

        :return: 1 on success, 0 on failure
        """
        try:
            self._info('menu item enabled of given menu item (%s, %s)' %
                       (window_name, menu_item))
            return ldtp.menuitemenabled(window_name, menu_item)
        except LdtpExecutionError:
            raise LdtpExecutionError("menu item enabled failed.")
Ejemplo n.º 2
0
 def test_view_indentguides(self):
     view_indentguides_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuView;mnuIndentGuides')
     self.assertTrue(view_indentguides_enabled)
Ejemplo n.º 3
0
 def test_edit_selectall(self):
     edit_selectall_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuEdit;mnuSelectAll')
     self.assertFalse(edit_selectall_enabled)
Ejemplo n.º 4
0
 def test_file_saveas(self):
     file_saveas_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuFile;mnuSave As')
     self.assertFalse(file_saveas_enabled)
Ejemplo n.º 5
0
 def test_help_about(self):
     help_about_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuHelp;mnuAbout')
     self.assertTrue(help_about_enabled)
Ejemplo n.º 6
0
 def test_tools_tabstospaces(self):
     tools_tabstospaces_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuTabstoSpaces')
     self.assertFalse(tools_tabstospaces_enabled)
Ejemplo n.º 7
0
 def test_tools_filemode(self):
     tools_filemode_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuFileMode')
     self.assertTrue(tools_filemode_enabled)
Ejemplo n.º 8
0
 def test_view_endofline(self):
     view_endofline_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuView;mnuEndofLine')
     self.assertTrue(view_endofline_enabled)
Ejemplo n.º 9
0
 def test_tools_formatselection(self):
     tools_formatselection_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuFormatSelection')
     self.assertFalse(tools_formatselection_enabled)
Ejemplo n.º 10
0
 def test_tools_lineends(self):
     tools_lineend_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuLineEnds')
     self.assertTrue(tools_lineend_enabled)
Ejemplo n.º 11
0
 def test_tools_filemode(self):
     tools_filemode_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuFileMode')
     self.assertTrue(tools_filemode_enabled)
Ejemplo n.º 12
0
 def test_view_statusbar(self):
     view_statusbar_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuView;mnuStatusBar')
     self.assertTrue(view_statusbar_enabled)
Ejemplo n.º 13
0
 def test_view_toolbar(self):
     view_toolbar_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuView;mnuToolBar')
     self.assertTrue(view_toolbar_enabled)
Ejemplo n.º 14
0
 def test_view_wordwrap(self):
     view_wordwrap_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuView;mnuWordWrap')
     self.assertTrue(view_wordwrap_enabled)
Ejemplo n.º 15
0
 def test_view_endofline(self):
     view_endofline_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuView;mnuEndofLine')
     self.assertTrue(view_endofline_enabled)
Ejemplo n.º 16
0
 def test_view_margin(self):
     view_margin_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuView;mnuMargin')
     self.assertTrue(view_margin_enabled)
Ejemplo n.º 17
0
 def test_view_activeline(self):
     view_activeline_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuView;mnuActiveLine')
     self.assertTrue(view_activeline_enabled)
Ejemplo n.º 18
0
 def test_tools_formatsource(self):
     tools_formatsource_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuFormatSource')
     self.assertTrue(tools_formatsource_enabled)
Ejemplo n.º 19
0
 def test_view_toolbar(self):
     view_toolbar_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuView;mnuToolBar')
     self.assertTrue(view_toolbar_enabled)
Ejemplo n.º 20
0
 def test_tools_tabstospaces(self):
     tools_tabstospaces_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuTabstoSpaces')
     self.assertTrue(tools_tabstospaces_enabled)
Ejemplo n.º 21
0
 def test_tools_formatselection(self):
     tools_formatselection_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuFormatSelection')
     self.assertFalse(tools_formatselection_enabled)
Ejemplo n.º 22
0
 def test_tools_striptrailingspaces(self):
     tools_striptrailingspaces_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuStripTrailingSpaces')
     self.assertTrue(tools_striptrailingspaces_enabled)
Ejemplo n.º 23
0
 def test_tools_astylesettings(self):
     tools_astylesettings_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuAStyleSettings')
     self.assertTrue(tools_astylesettings_enabled)
Ejemplo n.º 24
0
 def test_tools_astylesettings(self):
     tools_astylesettings_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuAStyleSettings')
     self.assertTrue(tools_astylesettings_enabled)
Ejemplo n.º 25
0
 def test_file_open(self):
     file_open_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuFile;mnuOpen')
     self.assertTrue(file_open_enabled)
Ejemplo n.º 26
0
 def test_tools_astyleoptions(self):
     tools_astyleoptions_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuAStyleOptions')
     self.assertTrue(tools_astyleoptions_enabled)
Ejemplo n.º 27
0
 def test_edit_redo(self):
     edit_redo_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuEdit;mnuRedo')
     self.assertFalse(edit_redo_enabled)
Ejemplo n.º 28
0
 def test_help_about(self):
     help_about_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuHelp;mnuAbout')
     self.assertTrue(help_about_enabled)
Ejemplo n.º 29
0
 def test_edit_selecttoend(self):
     edit_selecttoend_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuEdit;mnuSelecttoEnd')
     self.assertFalse(edit_selecttoend_enabled)
Ejemplo n.º 30
0
 def test_file_new(self):
     file_new_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuFile;mnuNew')
     self.assertTrue(file_new_enabled)
Ejemplo n.º 31
0
 def test_view_linenumbers(self):
     view_linenumbers_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuView;mnuLineNumbers')
     self.assertTrue(view_linenumbers_enabled)
Ejemplo n.º 32
0
 def test_file_open(self):
     file_open_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuFile;mnuOpen')
     self.assertTrue(file_open_enabled)
Ejemplo n.º 33
0
 def test_view_whitespace(self):
     view_whitespace_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuView;mnuWhitespace')
     self.assertTrue(view_whitespace_enabled)
Ejemplo n.º 34
0
 def test_file_close(self):
     file_close_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuFile;mnuClose')
     self.assertTrue(file_close_enabled)
Ejemplo n.º 35
0
 def test_view_indentguides(self):
     view_indentguides_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuView;mnuIndentGuides')
     self.assertTrue(view_indentguides_enabled)
Ejemplo n.º 36
0
 def test_file_save(self):
     file_save_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuFile;mnuSave')
     self.assertFalse(file_save_enabled)
Ejemplo n.º 37
0
 def test_view_wordwrap(self):
     view_wordwrap_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuView;mnuWordWrap')
     self.assertTrue(view_wordwrap_enabled)
Ejemplo n.º 38
0
 def test_file_saveas(self):
     file_saveas_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuFile;mnuSave As')
     self.assertTrue(file_saveas_enabled)
Ejemplo n.º 39
0
 def test_view_statusbar(self):
     view_statusbar_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuView;mnuStatusBar')
     self.assertTrue(view_statusbar_enabled)
Ejemplo n.º 40
0
 def test_file_exit(self):
     file_exit_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuFile;mnuExit')
     self.assertTrue(file_exit_enabled)
Ejemplo n.º 41
0
 def test_tools_lineends(self):
     tools_lineend_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuLineEnds')
     self.assertTrue(tools_lineend_enabled)
Ejemplo n.º 42
0
 def test_edit_redo(self):
     edit_redo_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuEdit;mnuRedo')
     self.assertFalse(edit_redo_enabled)
Ejemplo n.º 43
0
 def test_tools_formatsource(self):
     tools_formatsource_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuFormatSource')
     self.assertFalse(tools_formatsource_enabled)
Ejemplo n.º 44
0
 def test_edit_copy(self):
     edit_copy_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuEdit;mnuCopy')
     self.assertFalse(edit_copy_enabled)
Ejemplo n.º 45
0
 def test_tools_striptrailingspaces(self):
     tools_striptrailingspaces_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuStripTrailingSpaces')
     self.assertFalse(tools_striptrailingspaces_enabled)
Ejemplo n.º 46
0
 def test_edit_selectall(self):
     edit_selectall_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuEdit;mnuSelectAll')
     self.assertTrue(edit_selectall_enabled)
Ejemplo n.º 47
0
 def test_tools_astyleoptions(self):
     tools_astyleoptions_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuTools;mnuAStyleOptions')
     self.assertTrue(tools_astyleoptions_enabled)
Ejemplo n.º 48
0
 def test_edit_selecttostart(self):
     edit_selecttostart_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuEdit;mnuSelecttoStart')
     self.assertTrue(edit_selecttostart_enabled)
Ejemplo n.º 49
0
 def test_file_new(self):
     file_new_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuFile;mnuNew')
     self.assertTrue(file_new_enabled)
Ejemplo n.º 50
0
 def test_edit_selecttoend(self):
     edit_selecttoend_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuEdit;mnuSelecttoEnd')
     self.assertTrue(edit_selecttoend_enabled)
Ejemplo n.º 51
0
 def test_file_close(self):
     file_close_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuFile;mnuClose')
     self.assertFalse(file_close_enabled)
Ejemplo n.º 52
0
 def test_edit_selectblock(self):
     edit_selectblock_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuEdit;mnuSelectBlock')
     self.assertFalse(edit_selectblock_enabled)
Ejemplo n.º 53
0
 def test_file_exit(self):
     file_exit_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuFile;mnuExit')
     self.assertTrue(file_exit_enabled)
Ejemplo n.º 54
0
 def test_edit_decreaseindent(self):
     edit_decreaseindent_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuEdit;mnuDecreaseIndent')
     self.assertTrue(edit_decreaseindent_enabled)
Ejemplo n.º 55
0
 def test_edit_copy(self):
     edit_copy_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuEdit;mnuCopy')
     self.assertFalse(edit_copy_enabled)
Ejemplo n.º 56
0
 def test_edit_options(self):
     edit_options_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuEdit;mnuOptions')
     self.assertTrue(edit_options_enabled)
Ejemplo n.º 57
0
 def test_edit_selecttostart(self):
     edit_selecttostart_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuEdit;mnuSelecttoStart')
     self.assertFalse(edit_selecttostart_enabled)
Ejemplo n.º 58
0
 def test_search_clearallbookmarks(self):
     search_clearallbookmarks_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuSearch;mnuClearAllBookmarks')
     self.assertFalse(search_clearallbookmarks_enabled)
Ejemplo n.º 59
0
 def check_menu_enabled(self, window, menu_name):
     logger.info("check_menu_enabled")
     return ldtp.menuitemenabled(RHSMGuiLocator().get_locator(window), RHSMGuiLocator().get_locator(menu_name))
Ejemplo n.º 60
0
 def test_view_activeline(self):
     view_activeline_enabled = ldtp.menuitemenabled('frmAStyleWx', 'mnuView;mnuActiveLine')
     self.assertTrue(view_activeline_enabled)