Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes clear tests to run selection when using Text Editor #2854

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
2 changes: 2 additions & 0 deletions src/robotide/application/CHANGELOG.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_changed"></a>1.2. Changed</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
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 <code class="literal">Tools -&gt; Preferences -&gt; Text Editor -&gt; Enable auto suggestions</code>.
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_fixed"></a>1.3. Fixed</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Fixed on Text Editor when Saving the selection of tests to run in Test Suites (Tree) is cleared.
</li><li class="listitem">
Fixed wrong item selection, like Test Suite, when doing right-click actions in Project Explorer.
</li><li class="listitem">
Fixed delete variable from Test Suite settings remaining in Project Explorer.
Expand Down
3 changes: 2 additions & 1 deletion src/robotide/application/releasenotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def set_content(self, html_win, content):
<li>This version supports Python 3.8 up to 3.12.</li>
<li>There are some changes, or known issues:<ul>
<li>❌ - Removed support for Python 3.6 and 3.7</li>
<li>✔ - Fixed on Text Editor when Saving the selection of tests to run in Test Suites (Tree) is cleared.</li>
<li>✔ - Added Korean language support for UI, experimental.</li>
<li>✔ - Added <b>caret style</b> to change insert caret to 'block' or 'line' in Text Editor, by editing
<em>settings.cfg</em>. The color of the caret is the same as 'setting' and will be adjusted for better contrast with the
Expand Down Expand Up @@ -186,7 +187,6 @@ def set_content(self, html_win, content):
<li>✔ - 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.</li>
<li>✔ - Newlines in Grid Editor can be made visible with the <b>filter newlines</b> set to False.</li>
<li>🐞 - On Text Editor when Saving the selection of tests in Test Suites (Tree) is cleared.</li>
<li>🐞 - 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 <em>recommend</em>.</li>
<li>🐞 - Some argument types detection (and colorization) is not correct in Grid Editor.</li>
Expand All @@ -197,6 +197,7 @@ def set_content(self, html_win, content):
</ul>
<p><strong>New Features and Fixes Highlights</strong></p>
<ul class="simple">
<li>Fixed on Text Editor when Saving the selection of tests to run in Test Suites (Tree) is cleared.</li>
<li>Added Korean language support for UI, experimental.</li>
<li>Fixed wrong item selection, like Test Suite, when doing right-click actions in Project Explorer.</li>
<li>Fixed delete variable from Test Suite settings remaining in Project Explorer.</li>
Expand Down
8 changes: 8 additions & 0 deletions src/robotide/controller/ui/treecontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions src/robotide/editor/texteditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/robotide/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
#
# Automatically generated by `tasks.py`.

VERSION = 'v2.1dev69'
VERSION = 'v2.1dev70'
6 changes: 6 additions & 0 deletions utest/controller/ui/test_treecontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading