From cb34bb602dfaf25e88418737d79ea867e1c273c8 Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Fri, 16 Aug 2024 13:32:40 +0100 Subject: [PATCH] Fixes clear tests to run selection when using Text Editor --- CHANGELOG.adoc | 1 + README.adoc | 2 +- src/robotide/application/CHANGELOG.html | 2 ++ src/robotide/application/releasenotes.py | 3 ++- src/robotide/controller/ui/treecontroller.py | 8 ++++++++ src/robotide/editor/texteditor.py | 4 ++-- src/robotide/version.py | 2 +- utest/controller/ui/test_treecontroller.py | 6 ++++++ 8 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index abe9c7dd9..6a1a04ae2 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -21,6 +21,7 @@ The color of the caret is the same as `setting` and will be adjusted for better === Fixed +- Fixed on Text Editor when Saving the selection of tests to run in Test Suites (Tree) is cleared. - Fixed wrong item selection, like Test Suite, when doing right-click actions in Project Explorer. - Fixed delete variable from Test Suite settings remaining in Project Explorer. - Fixed obsfuscation of Libraries and Metadata panels when expanding Settings in Grid Editor and Linux systems. diff --git a/README.adoc b/README.adoc index c81e31add..223a398b7 100644 --- a/README.adoc +++ b/README.adoc @@ -40,7 +40,7 @@ Likewise, the current version of wxPython, is 4.2.1, but RIDE is known to work w `pip install -U robotframework-ride` -(3.8 <= python <= 3.12) Install current development version (**2.1dev69**) with: +(3.8 <= python <= 3.12) Install current development version (**2.1dev70**) with: `pip install -U https://github.com/robotframework/RIDE/archive/master.zip` diff --git a/src/robotide/application/CHANGELOG.html b/src/robotide/application/CHANGELOG.html index 1b361e9ee..f09838863 100644 --- a/src/robotide/application/CHANGELOG.html +++ b/src/robotide/application/CHANGELOG.html @@ -8,6 +8,8 @@

1.2. Changed

  • Allow to do auto-suggestions of keywords in Text Editor without a shortcut, if you want to enable or disable this feature you can config in Tools -> Preferences -> Text Editor -> Enable auto suggestions.

1.3. Fixed

  • +Fixed on Text Editor when Saving the selection of tests to run in Test Suites (Tree) is cleared. +
  • Fixed wrong item selection, like Test Suite, when doing right-click actions in Project Explorer.
  • Fixed delete variable from Test Suite settings remaining in Project Explorer. diff --git a/src/robotide/application/releasenotes.py b/src/robotide/application/releasenotes.py index 3fec22393..5fd5f799e 100644 --- a/src/robotide/application/releasenotes.py +++ b/src/robotide/application/releasenotes.py @@ -158,6 +158,7 @@ def set_content(self, html_win, content):
  • This version supports Python 3.8 up to 3.12.
  • There are some changes, or known issues:
    • ❌ - Removed support for Python 3.6 and 3.7
    • +
    • ✔ - Fixed on Text Editor when Saving the selection of tests to run in Test Suites (Tree) is cleared.
    • ✔ - Added Korean language support for UI, experimental.
    • ✔ - Added caret style to change insert caret to 'block' or 'line' in Text Editor, by editing settings.cfg. The color of the caret is the same as 'setting' and will be adjusted for better contrast with the @@ -186,7 +187,6 @@ def set_content(self, html_win, content):
    • ✔ - When editing in Grid Editor with content assistance, the selected content can be edited by escaping the list of suggestions with keys ARROW_LEFT or ARROW_RIGHT.
    • ✔ - Newlines in Grid Editor can be made visible with the filter newlines set to False.
    • -
    • 🐞 - On Text Editor when Saving the selection of tests in Test Suites (Tree) is cleared.
    • 🐞 - Problems with COPY/PASTE in Text Editor have been reported when using wxPython 4.2.0, but not with version 4.2.1, which we now recommend.
    • 🐞 - Some argument types detection (and colorization) is not correct in Grid Editor.
    • @@ -197,6 +197,7 @@ def set_content(self, html_win, content):

    New Features and Fixes Highlights

      +
    • Fixed on Text Editor when Saving the selection of tests to run in Test Suites (Tree) is cleared.
    • Added Korean language support for UI, experimental.
    • Fixed wrong item selection, like Test Suite, when doing right-click actions in Project Explorer.
    • Fixed delete variable from Test Suite settings remaining in Project Explorer.
    • diff --git a/src/robotide/controller/ui/treecontroller.py b/src/robotide/controller/ui/treecontroller.py index 281660324..fe9a082e0 100644 --- a/src/robotide/controller/ui/treecontroller.py +++ b/src/robotide/controller/ui/treecontroller.py @@ -230,12 +230,20 @@ def select(self, test: TestCaseController, do_select=True, notify_selection=True self._send_selection_changed_message() def remove_invalid_cases_selection(self, cases_file_controller): + from .. import ResourceFileController invalid_cases = list() + to_select_cases = list() for test in self._tests: if test.datafile_controller == cases_file_controller: + if not isinstance(cases_file_controller, ResourceFileController): + for newobj in cases_file_controller.tests: + if test.longname == newobj.longname: + to_select_cases.append(newobj) invalid_cases.append(test) for _ in invalid_cases: self._tests.remove(_) + for test in to_select_cases: + self.select(test, True, False) self._send_selection_changed_message() def _send_selection_changed_message(self): diff --git a/src/robotide/editor/texteditor.py b/src/robotide/editor/texteditor.py index f065aea47..a1e30b618 100644 --- a/src/robotide/editor/texteditor.py +++ b/src/robotide/editor/texteditor.py @@ -134,7 +134,7 @@ def __init__(self, application): self._editor_component = None self._tab = None self._doc_language = None - self._save_flag = 0 # See + self._save_flag = 0 self.reformat = application.settings.get('reformat', False) self._register_shortcuts() @@ -257,7 +257,7 @@ def _should_process_data_changed_message(message): # and not isinstance(message, RideDataChangedToDirty)) def on_tree_selection(self, message): - # print(f"DEBUG: texteditor.py TextEditorPlugin on_tree_selection ENTER type={type(message.item)}") + # print(f"DEBUG: texteditor.py TextEditorPlugin on_tree_selection ENTER {message=} type={type(message.item)}") self._editor.store_position() if self.is_focused(): next_datafile_controller = message.item and message.item.datafile_controller diff --git a/src/robotide/version.py b/src/robotide/version.py index e2b6031be..2a2e56710 100644 --- a/src/robotide/version.py +++ b/src/robotide/version.py @@ -15,4 +15,4 @@ # # Automatically generated by `tasks.py`. -VERSION = 'v2.1dev69' +VERSION = 'v2.1dev70' diff --git a/utest/controller/ui/test_treecontroller.py b/utest/controller/ui/test_treecontroller.py index 19f295e4c..1932ffd0c 100644 --- a/utest/controller/ui/test_treecontroller.py +++ b/utest/controller/ui/test_treecontroller.py @@ -145,6 +145,12 @@ def test_test_selection_is_not_empty_when_it_contains_a_test(self): self._tsc.select(self._create_test()) self.assertFalse(self._tsc.is_empty()) + def test_remove_invalid_cases_selection(self): + self._tsc.select(self._create_test()) + new_test = self._create_test() + self._tsc.remove_invalid_cases_selection(new_test.datafile_controller) + self.assertFalse(self._tsc.is_empty()) + def test_test_selection_is_empty_after_removing_same_test_from_there_even_when_it_is_not_the_same_object(self): test = self._create_test() self._tsc.select(test)