Skip to content

Commit 963ca0e

Browse files
Merge pull request #2854 from HelioGuilherme66/keep_checked_tests
Fixes clear tests to run selection when using Text Editor
2 parents 6bdfbce + cb34bb6 commit 963ca0e

File tree

8 files changed

+23
-5
lines changed

8 files changed

+23
-5
lines changed

CHANGELOG.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The color of the caret is the same as `setting` and will be adjusted for better
2121

2222
=== Fixed
2323

24+
- Fixed on Text Editor when Saving the selection of tests to run in Test Suites (Tree) is cleared.
2425
- Fixed wrong item selection, like Test Suite, when doing right-click actions in Project Explorer.
2526
- Fixed delete variable from Test Suite settings remaining in Project Explorer.
2627
- Fixed obsfuscation of Libraries and Metadata panels when expanding Settings in Grid Editor and Linux systems.

README.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Likewise, the current version of wxPython, is 4.2.1, but RIDE is known to work w
4040

4141
`pip install -U robotframework-ride`
4242

43-
(3.8 <= python <= 3.12) Install current development version (**2.1dev69**) with:
43+
(3.8 <= python <= 3.12) Install current development version (**2.1dev70**) with:
4444

4545
`pip install -U https://github.com/robotframework/RIDE/archive/master.zip`
4646

src/robotide/application/CHANGELOG.html

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
</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">
99
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>.
1010
</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">
11+
Fixed on Text Editor when Saving the selection of tests to run in Test Suites (Tree) is cleared.
12+
</li><li class="listitem">
1113
Fixed wrong item selection, like Test Suite, when doing right-click actions in Project Explorer.
1214
</li><li class="listitem">
1315
Fixed delete variable from Test Suite settings remaining in Project Explorer.

src/robotide/application/releasenotes.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ def set_content(self, html_win, content):
158158
<li>This version supports Python 3.8 up to 3.12.</li>
159159
<li>There are some changes, or known issues:<ul>
160160
<li>❌ - Removed support for Python 3.6 and 3.7</li>
161+
<li>✔ - Fixed on Text Editor when Saving the selection of tests to run in Test Suites (Tree) is cleared.</li>
161162
<li>✔ - Added Korean language support for UI, experimental.</li>
162163
<li>✔ - Added <b>caret style</b> to change insert caret to 'block' or 'line' in Text Editor, by editing
163164
<em>settings.cfg</em>. 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):
186187
<li>✔ - When editing in Grid Editor with content assistance, the selected content can be edited by escaping the list of
187188
suggestions with keys ARROW_LEFT or ARROW_RIGHT.</li>
188189
<li>✔ - Newlines in Grid Editor can be made visible with the <b>filter newlines</b> set to False.</li>
189-
<li>🐞 - On Text Editor when Saving the selection of tests in Test Suites (Tree) is cleared.</li>
190190
<li>🐞 - Problems with COPY/PASTE in Text Editor have been reported when using wxPython 4.2.0, but not with
191191
version 4.2.1, which we now <em>recommend</em>.</li>
192192
<li>🐞 - Some argument types detection (and colorization) is not correct in Grid Editor.</li>
@@ -197,6 +197,7 @@ def set_content(self, html_win, content):
197197
</ul>
198198
<p><strong>New Features and Fixes Highlights</strong></p>
199199
<ul class="simple">
200+
<li>Fixed on Text Editor when Saving the selection of tests to run in Test Suites (Tree) is cleared.</li>
200201
<li>Added Korean language support for UI, experimental.</li>
201202
<li>Fixed wrong item selection, like Test Suite, when doing right-click actions in Project Explorer.</li>
202203
<li>Fixed delete variable from Test Suite settings remaining in Project Explorer.</li>

src/robotide/controller/ui/treecontroller.py

+8
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,20 @@ def select(self, test: TestCaseController, do_select=True, notify_selection=True
230230
self._send_selection_changed_message()
231231

232232
def remove_invalid_cases_selection(self, cases_file_controller):
233+
from .. import ResourceFileController
233234
invalid_cases = list()
235+
to_select_cases = list()
234236
for test in self._tests:
235237
if test.datafile_controller == cases_file_controller:
238+
if not isinstance(cases_file_controller, ResourceFileController):
239+
for newobj in cases_file_controller.tests:
240+
if test.longname == newobj.longname:
241+
to_select_cases.append(newobj)
236242
invalid_cases.append(test)
237243
for _ in invalid_cases:
238244
self._tests.remove(_)
245+
for test in to_select_cases:
246+
self.select(test, True, False)
239247
self._send_selection_changed_message()
240248

241249
def _send_selection_changed_message(self):

src/robotide/editor/texteditor.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def __init__(self, application):
134134
self._editor_component = None
135135
self._tab = None
136136
self._doc_language = None
137-
self._save_flag = 0 # See
137+
self._save_flag = 0
138138
self.reformat = application.settings.get('reformat', False)
139139
self._register_shortcuts()
140140

@@ -257,7 +257,7 @@ def _should_process_data_changed_message(message):
257257
# and not isinstance(message, RideDataChangedToDirty))
258258

259259
def on_tree_selection(self, message):
260-
# print(f"DEBUG: texteditor.py TextEditorPlugin on_tree_selection ENTER type={type(message.item)}")
260+
# print(f"DEBUG: texteditor.py TextEditorPlugin on_tree_selection ENTER {message=} type={type(message.item)}")
261261
self._editor.store_position()
262262
if self.is_focused():
263263
next_datafile_controller = message.item and message.item.datafile_controller

src/robotide/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
#
1616
# Automatically generated by `tasks.py`.
1717

18-
VERSION = 'v2.1dev69'
18+
VERSION = 'v2.1dev70'

utest/controller/ui/test_treecontroller.py

+6
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ def test_test_selection_is_not_empty_when_it_contains_a_test(self):
145145
self._tsc.select(self._create_test())
146146
self.assertFalse(self._tsc.is_empty())
147147

148+
def test_remove_invalid_cases_selection(self):
149+
self._tsc.select(self._create_test())
150+
new_test = self._create_test()
151+
self._tsc.remove_invalid_cases_selection(new_test.datafile_controller)
152+
self.assertFalse(self._tsc.is_empty())
153+
148154
def test_test_selection_is_empty_after_removing_same_test_from_there_even_when_it_is_not_the_same_object(self):
149155
test = self._create_test()
150156
self._tsc.select(test)

0 commit comments

Comments
 (0)