Ejemplo n.º 1
0
 def test_for_loop_move_with_undo_preserves_correct_celltype(self):
     test = self.project.datafiles[1].tests[0]
     test.execute(MoveRowsDown([0]))
     test.execute(MoveRowsDown([1]))
     self.assertEqual(test.get_cell_info(1,1).cell_type, CellType.ASSIGN)
     test.execute(Undo())
     test.execute(Undo())
     self.assertEqual(test.get_cell_info(1,1).cell_type, CellType.KEYWORD)
Ejemplo n.º 2
0
 def OnUndo(self, event=None):
     _iscelleditcontrolshown = self.IsCellEditControlShown()
     if not _iscelleditcontrolshown:
         self._execute(Undo())
     else:
         self.GetCellEditor(*self.selection.cell).Reset()
     self._resize_grid()
Ejemplo n.º 3
0
 def test_delete_keyword_undo(self):
     new_kw_name = 'Jiihaa'
     self._exec(AddKeyword(new_kw_name))
     self._exec(RemoveMacro(self._new_keyword))
     self._new_keyword = None
     self._exec(Undo())
     assert_equal(self._new_keyword.name, new_kw_name)
Ejemplo n.º 4
0
    def test_sort_and_restore_tests(self):
        # Add tests
        for test in ['Blabla', 'Atest', '2222222', '111111']:
            new_test = TestCaseController(self.ctrl, TestCase(TestCaseFile(), test))
            self.ctrl.add_test_or_keyword(new_test)

        # Capture test list before sorting
        original_tests = self.get_test_names()
        list_for_undo_comparison = original_tests[:]

        # Sort the list
        self.ctrl.execute(SortTests())
        sorted_tests = self.get_test_names()
        original_tests.sort()
        assert_equal(original_tests, sorted_tests)

        # Undo sorting
        self.ctrl.execute(Undo())
        restored_list = self.get_test_names()
        assert_equal(restored_list, list_for_undo_comparison)

        # Redo sorting
        self.ctrl.execute(Redo())
        keywords_after_redo = self.get_test_names()
        assert_equal(keywords_after_redo, sorted_tests)
Ejemplo n.º 5
0
 def test_create_and_remove_keyword(self):
     kw_name = 'Super Keyword'
     self.test.execute(ChangeCellValue(0, 0, kw_name))
     self._verify_cell_info(0, 0, ContentType.STRING, CellType.KEYWORD)
     self.test.execute(AddKeyword(kw_name, '${argh}'))
     self._verify_cell_info(0, 0, ContentType.USER_KEYWORD, CellType.KEYWORD)
     self._verify_cell_info(0, 1, ContentType.EMPTY, CellType.MANDATORY)
     self.test.execute(Undo())
     self._verify_cell_info(0, 0, ContentType.STRING, CellType.KEYWORD)
     self._verify_cell_info(0, 1, ContentType.EMPTY, CellType.UNKNOWN)
Ejemplo n.º 6
0
 def OnUndo(self, event=None):
     """ Fixed on 4.0.0a3
     if wx.VERSION >= (3, 0, 3, ''):  # DEBUG wxPhoenix
         _iscelleditcontrolshown = self.IsCellEditControlEnabled()
     else:
     """
     _iscelleditcontrolshown = self.IsCellEditControlShown()
     if not _iscelleditcontrolshown:
         self._execute(Undo())
     else:
         self.GetCellEditor(*self.selection.cell).Reset()
Ejemplo n.º 7
0
    def test_sort_and_restore_variables(self):
        # Capture test list before sorting
        original_variables = self.get_variable_names()
        list_for_undo_comparison = original_variables[:]

        # Sort the list
        self.ctrl.execute(SortVariables())
        sorted_variables = self.get_variable_names()
        original_variables.sort()
        assert_equal(original_variables, sorted_variables)

        # Undo sorting
        self.ctrl.execute(Undo())
        restored_list = self.get_variable_names()
        assert_equal(restored_list, list_for_undo_comparison)

        # Redo sorting
        self.ctrl.execute(Redo())
        variables_after_redo = self.get_variable_names()
        assert_equal(variables_after_redo, sorted_variables)
    def test_sort_and_restore_keywords(self):
        # Capture keyword list before sorting
        original_keywords = self.ctrl.get_keyword_names()
        list_for_undo_comparison = original_keywords[:]

        # Sort the list
        self.ctrl.execute(SortKeywords())
        sorted_keywords = self.ctrl.get_keyword_names()
        original_keywords.sort()
        assert_equal(original_keywords, sorted_keywords)

        # Undo sorting
        self.ctrl.execute(Undo())
        restored_list = self.ctrl.get_keyword_names()
        assert_equal(restored_list, list_for_undo_comparison)

        # Redo sorting
        self.ctrl.execute(Redo())
        keywords_after_redo = self.ctrl.get_keyword_names()
        assert_equal(keywords_after_redo, sorted_keywords)
Ejemplo n.º 9
0
    def test_sort_and_restore_keywords(self):
        resource_ctrl = self._get_ctrl_by_name(datafilereader.SIMPLE_TEST_SUITE_RESOURCE_NAME)

        # Capture keyword list before sorting
        original_keywords = self.ctrl.get_keyword_names()
        list_for_undo_comparison = original_keywords[:]

        # Sort the list
        self.ctrl.execute(SortKeywords())
        sorted_keywords = self.ctrl.get_keyword_names()
        original_keywords.sort()
        assert_equal(original_keywords, sorted_keywords)

        # Undo sorting
        self.ctrl.execute(Undo())
        restored_list = self.ctrl.get_keyword_names()
        assert_equal(restored_list, list_for_undo_comparison)

        # Redo sorting
        self.ctrl.execute(Redo())
        keywords_after_redo = self.ctrl.get_keyword_names()
        assert_equal(keywords_after_redo, sorted_keywords)
Ejemplo n.º 10
0
 def undo(self):
     self._macro_execute(Undo())
Ejemplo n.º 11
0
 def test_undo_after_renaming_to_something_that_is_already_there(self):
     self._rename(STEP1_KEYWORD, STEP2_ARGUMENT, TEST1_NAME, 'Steps')
     self.test_ctrl.execute(Undo())
     assert_equal(self.test_ctrl.steps[1].args[0], STEP2_ARGUMENT)
Ejemplo n.º 12
0
 def test_undo_rename_in_step(self):
     self._rename(STEP1_KEYWORD, UNUSED_KEYWORD_NAME, TEST1_NAME, 'Steps')
     self.test_ctrl.execute(Undo())
     assert_equal(self.test_ctrl.steps[0].keyword, STEP1_KEYWORD)
Ejemplo n.º 13
0
 def test_add_keyword_undo(self):
     new_kw_name = 'Jiihaa'
     self._exec(AddKeyword(new_kw_name))
     assert_equal(self._new_keyword.name, new_kw_name)
     self._exec(Undo())
     assert_equal(self._deleted_keyword.name, new_kw_name)
Ejemplo n.º 14
0
 def not_implemented_test_undoing_extract(self):
     new_kw_name = 'New Keyword'
     self._exec(ExtractKeyword(new_kw_name, '', (0, 1)))
     self._exec(Undo())
     self._verify_step_number_change(0)