Skip to content

Commit 924fe46

Browse files
Merge pull request #2935 from HelioGuilherme66/testrunner_improv
Testrunner improvements
2 parents db6eaad + 8d07be7 commit 924fe46

File tree

6 files changed

+77
-10
lines changed

6 files changed

+77
-10
lines changed

CHANGELOG.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni
99
== https://github.com/robotframework/RIDE[Unreleased]
1010

1111
=== Added
12+
- Added current executing keyword and other statuses to TestRunner status bar.
1213
- Added Config Panel button to supported installed Plugins next to their name in Plugin Manager dialog.
13-
- Added Config Panel button to Plugins, working example in Text Editor.
14+
- Added Config Panel button to Plugins, working examples in Text Editor and Test Runner.
1415
- Added divided Status Bar. Left side for main window, right side for Plugins. Working example in Text Editor,
1516
when selecting in Tree shows the filename in StatusBar.
1617

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Likewise, the current version of wxPython, is 4.2.2, but RIDE is known to work w
4040

4141
`pip install -U robotframework-ride`
4242

43-
(3.8 <= python <= 3.13) Install current development version (**2.2dev18**) with:
43+
(3.8 <= python <= 3.13) Install current development version (**2.2dev19**) with:
4444

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

src/robotide/application/CHANGELOG.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Changelog</title><link rel="stylesheet" type="text/css" href="docbook-xsl.css" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /></head><body><div xml:lang="en" class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id1337"></a>Changelog</h2></div></div><hr /></div><p>All notable changes to this project will be documented in this file.</p><p>The format is based on <a class="ulink" href="http://keepachangelog.com/en/1.0.0/" target="_top">Keep a Changelog</a>
33
and this project adheres to <a class="ulink" href="http://semver.org/spec/v2.0.0.html" target="_top">Semantic Versioning</a>.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_ulink_url_https_github_com_robotframework_ride_unreleased_ulink"></a>1. <a class="ulink" href="https://github.com/robotframework/RIDE" target="_top">Unreleased</a></h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_added"></a>1.1. Added</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
4+
Added current executing keyword and other statuses to TestRunner status bar.
5+
</li><li class="listitem">
46
Added Config Panel button to supported installed Plugins next to their name in Plugin Manager dialog.
57
</li><li class="listitem">
6-
Added Config Panel button to Plugins, working example in Text Editor.
8+
Added Config Panel button to Plugins, working examples in Text Editor and Test Runner.
79
</li><li class="listitem">
810
Added divided Status Bar. Left side for main window, right side for Plugins. Working example in Text Editor,
911
when selecting in Tree shows the filename in StatusBar.

src/robotide/application/releasenotes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,10 @@ def set_content(self, html_win, content):
170170
</ul>
171171
<p><strong>New Features and Fixes Highlights</strong></p>
172172
<ul class="simple">
173+
<li>Added current executing keyword and other statuses to TestRunner status bar.</li>
173174
<li>Modified import statements to allow running RIDE without Robot Framework installed or versions older than 6.0.</li>
174175
<li>Added Config Panel button to supported installed Plugins next to their name in Plugin Manager dialog.</li>
175-
<li>Added Config Panel button to Plugins, working example in Text Editor.</li>
176+
<li>Added Config Panel button to Plugins, working examples in Text Editor and Test Runner.</li>
176177
<li>On Windows ignore false modification on files when opening Test Suites, causing confirmation dialog.</li>
177178
<li>Added divided Status Bar. Left side for main window, right side for Plugins. Working example in Text Editor,
178179
when selecting in Tree shows the filename in StatusBar.</li>

src/robotide/contrib/testrunner/testrunnerplugin.py

Lines changed: 68 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@
7777
from robotide.publish.messages import RideTestSelectedForRunningChanged
7878
from robotide.pluginapi import Plugin, ActionInfo
7979
from robotide.ui.notebook import NoteBook
80-
from robotide.widgets import Label, ImageProvider, RIDEDialog
80+
from robotide.widgets import Label, ImageProvider, ButtonWithHandler, RIDEDialog
8181
from robotide.robotapi import LOG_LEVELS
8282
from robotide.utils import robottime
83+
from robotide.preferences import PreferenceEditor
8384
from robotide.preferences.editors import read_fonts
8485
from sys import getfilesystemencoding, platform
8586
from robotide.lib.robot.utils.encodingsniffer import (get_console_encoding,
@@ -134,6 +135,7 @@ class TestRunnerPlugin(Plugin):
134135
"profile_name": "robot",
135136
"show_console_log": True,
136137
"show_message_log": True,
138+
"active_status_bar": True,
137139
"sash_position": 200,
138140
"run_profiles":
139141
[('jybot', 'jybot' + ('.bat' if os.name == 'nt' else '')),
@@ -155,6 +157,7 @@ class TestRunnerPlugin(Plugin):
155157
title = 'Run'
156158

157159
def __init__(self, application=None):
160+
self.app = application
158161
self.title = _('Run')
159162
Plugin.__init__(self, application, initially_enabled=True,
160163
default_settings=self.defaults)
@@ -178,6 +181,7 @@ def __init__(self, application=None):
178181
self._initmemory = None
179182
self._limitmemory = None # This will be +80%
180183
self._maxmemmsg = None
184+
self.active_status_bar = self.__getattr__('active_status_bar')
181185
self.use_colors = self.__getattr__('use colors')
182186
self.fail_color = self.__getattr__('fail color')
183187
self.pass_color = self.__getattr__('pass color')
@@ -321,30 +325,40 @@ def on_stop(self, event):
321325
self._append_to_console_log(_('[ SENDING STOP SIGNAL ]\n'),
322326
source='stderr')
323327
self._test_runner.send_stop_signal()
328+
if self.active_status_bar:
329+
self.statusbar_message(_('[ SENDING STOP SIGNAL ]\n'), 5000)
324330

325331
def on_pause(self, event):
326332
__ = event
327333
self._reset_memory_calc()
328334
self._append_to_console_log(_('[ SENDING PAUSE SIGNAL ]\n'))
329335
self._test_runner.send_pause_signal()
336+
if self.active_status_bar:
337+
self.statusbar_message(_('[ SENDING PAUSE SIGNAL ]\n'), 5000)
330338

331339
def on_continue(self, event):
332340
__ = event
333341
self._reset_memory_calc()
334342
self._append_to_console_log(_('[ SENDING CONTINUE SIGNAL ]\n'))
335343
self._test_runner.send_continue_signal()
344+
if self.active_status_bar:
345+
self.statusbar_message(_('[ SENDING CONTINUE SIGNAL ]\n'), 5000)
336346

337347
def on_step_next(self, event):
338348
__ = event
339349
self._reset_memory_calc()
340350
self._append_to_console_log(_('[ SENDING STEP NEXT SIGNAL ]\n'))
341351
self._test_runner.send_step_next_signal()
352+
if self.active_status_bar:
353+
self.statusbar_message(_('[ SENDING STEP NEXT SIGNAL ]\n'), 5000)
342354

343355
def on_step_over(self, event):
344356
__ = event
345357
self._reset_memory_calc()
346358
self._append_to_console_log(_('[ SENDING STEP OVER SIGNAL ]\n'))
347359
self._test_runner.send_step_over_signal()
360+
if self.active_status_bar:
361+
self.statusbar_message(_('[ SENDING STEP OVER SIGNAL ]\n'), 5000)
348362

349363
def on_run(self, event):
350364
""" Called when the user clicks or presses the F8, Run Tests """
@@ -735,8 +749,11 @@ def _remove_from_notebook(self):
735749
def _build_runner_toolbar(self, parent):
736750
toolbar = wx.ToolBar(parent, wx.ID_ANY,
737751
style=wx.TB_HORIZONTAL | wx.TB_HORZ_TEXT | wx.TB_NODIVIDER)
752+
toolbar.SetThemeEnabled(True)
738753
toolbar.SetBackgroundColour(self._mysettings.color_background)
739754
toolbar.SetForegroundColour(self._mysettings.color_foreground)
755+
toolbar.SetOwnBackgroundColour(self._mysettings.color_background)
756+
toolbar.SetOwnForegroundColour(self._mysettings.color_foreground)
740757
toolbar.AddTool(ID_RUN, _("Start"), ImageProvider().TOOLBAR_PLAY,
741758
wx.NullBitmap, wx.ITEM_NORMAL, shortHelp=_("Start robot"),
742759
longHelp=_("Start running the robot test suite"))
@@ -763,6 +780,10 @@ def _build_runner_toolbar(self, parent):
763780
toolbar.AddTool(ID_STEP_OVER, STEP_OVER, ImageProvider().TOOLBAR_NEXT,
764781
wx.NullBitmap, wx.ITEM_NORMAL, shortHelp=STEP_OVER,
765782
longHelp=STEP_OVER)
783+
for i in toolbar.GetChildren():
784+
i.SetBackgroundColour(self._mysettings.color_secondary_background)
785+
i.SetOwnBackgroundColour(self._mysettings.color_secondary_background)
786+
i.SetForegroundColour(self._mysettings.color_secondary_foreground)
766787
toolbar.Realize()
767788
self._bind_runner_toolbar_events(toolbar)
768789
return toolbar
@@ -778,10 +799,18 @@ def _bind_runner_toolbar_events(self, toolbar):
778799
(wx.EVT_TOOL, self.on_step_over, ID_STEP_OVER)):
779800
toolbar.Bind(event, callback, id=idd)
780801

802+
@property
803+
def general_font_size(self):
804+
fsize = self.app.settings.get('General', None)['font size']
805+
return fsize
806+
781807
def _build_local_toolbar(self, parent):
782808
toolbar = wx.ToolBar(parent, wx.ID_ANY,
783809
style=wx.TB_HORIZONTAL | wx.TB_HORZ_TEXT | wx.TB_NODIVIDER | wx.TB_DOCKABLE)
784810
# print(f"DEBUG: toolbar before {toolbar.UseBackgroundColour()}")
811+
toolbar.SetThemeEnabled(True)
812+
toolbar.SetBackgroundColour(self._mysettings.color_background)
813+
toolbar.SetForegroundColour(self._mysettings.color_foreground)
785814
toolbar.SetOwnBackgroundColour(self._mysettings.color_background)
786815
toolbar.SetOwnForegroundColour(self._mysettings.color_foreground)
787816
profile_label = Label(toolbar, label=_("Execution Profile: "))
@@ -817,12 +846,19 @@ def _build_local_toolbar(self, parent):
817846
_(" Pause after failure "), False,
818847
_("Automatically pause after failing keyword"))
819848
toolbar.AddControl(self.pause_on_failure_cb)
820-
849+
config_button = ButtonWithHandler(toolbar, _('Settings'), bitmap='wrench.png', fsize=self.general_font_size,
850+
handler=lambda e: self.on_config_panel())
851+
config_button.SetBackgroundColour(self._mysettings.color_background)
852+
config_button.SetOwnBackgroundColour(self._mysettings.color_background)
853+
config_button.SetForegroundColour(self._mysettings.color_foreground)
854+
toolbar.AddStretchableSpace()
855+
toolbar.AddControl(config_button)
821856
toolbar.EnableTool(ID_OPEN_LOGS_DIR, False)
822857
toolbar.EnableTool(ID_SHOW_LOG, False)
823858
toolbar.EnableTool(ID_SHOW_REPORT, False)
824859
for i in toolbar.GetChildren():
825860
i.SetBackgroundColour(self._mysettings.color_background)
861+
i.SetOwnBackgroundColour(self._mysettings.color_background)
826862
i.SetForegroundColour(self._mysettings.color_foreground)
827863
toolbar.Realize()
828864
self._bind_local_toolbar_events(toolbar)
@@ -921,7 +957,8 @@ def _build_output_panel(self, parent):
921957
panel = wx.Panel(parent)
922958
panel.SetBackgroundColour(self._mysettings.color_background)
923959
panel.SetForegroundColour(self._mysettings.color_foreground)
924-
self._progress_bar = ProgressBar(panel, self.fail_color, self.pass_color, self.skip_color)
960+
self._progress_bar = ProgressBar(panel, self.fail_color, self.pass_color, self.skip_color,
961+
self.active_status_bar, caller=self)
925962
self._console_log_panel, self._console_log_ctrl = \
926963
self._create_collapsible_pane(panel, _('Console log'),
927964
self.show_console_log,
@@ -1092,11 +1129,15 @@ def _handle_paused(self, args):
10921129
__ = args
10931130
wx.CallAfter(self._set_paused)
10941131
self._log_message_queue.put(_('<< PAUSED >>'))
1132+
if self.active_status_bar:
1133+
self.statusbar_message(_('<< PAUSED >>'))
10951134

10961135
def _handle_continue(self, args):
10971136
__ = args
10981137
wx.CallAfter(self._set_continue)
10991138
self._log_message_queue.put(_('<< CONTINUE >>'))
1139+
if self.active_status_bar:
1140+
self.statusbar_message(_('<< CONTINUE >>'), 5000)
11001141

11011142
def _set_running(self):
11021143
self._run_action.disable()
@@ -1105,6 +1146,8 @@ def _set_running(self):
11051146
self.get_current_profile().disable_toolbar()
11061147
self._running = True
11071148
self._test_runner.test_execution_started()
1149+
if self.active_status_bar:
1150+
self.statusbar_clear()
11081151

11091152
def _set_paused(self):
11101153
self._run_action.disable()
@@ -1122,6 +1165,8 @@ def _set_stopped(self):
11221165
self._enable_runner_toolbar(True, False)
11231166
self.get_current_profile().enable_toolbar()
11241167
self._running = False
1168+
if self.active_status_bar:
1169+
self.statusbar_clear()
11251170

11261171
def _enable_runner_toolbar(self, run, paused):
11271172
stop = not run
@@ -1142,11 +1187,24 @@ def _notify_user_no_logs_directory():
11421187
_("No logs directory"),
11431188
wx.ICON_INFORMATION | wx.OK)
11441189

1190+
def on_config_panel(self):
1191+
dlg = self.config_panel(self.frame)
1192+
dlg.Show(True)
1193+
1194+
def config_panel(self, parent):
1195+
__ = parent
1196+
_parent = wx.GetTopLevelWindows()
1197+
dlg = PreferenceEditor(_parent[0], _("RIDE - Preferences"),
1198+
self.app.preferences, style='single', index=5)
1199+
dlg.Show(False)
1200+
return dlg
1201+
11451202

11461203
class ProgressBar(wx.Panel):
11471204
"""A progress bar for the test runner plugin"""
11481205

1149-
def __init__(self, parent, fail_color='#FF8E8E', pass_color="#9FCC9F", skip_color='yellow'):
1206+
def __init__(self, parent, fail_color='#FF8E8E', pass_color="#9FCC9F", skip_color='yellow',
1207+
active_status_bar=False, caller=None):
11501208
wx.Panel.__init__(self, parent, wx.ID_ANY)
11511209
self._sizer = wx.BoxSizer(wx.HORIZONTAL)
11521210
self._gauge = wx.Gauge(self, size=(100, 15), style=wx.GA_HORIZONTAL)
@@ -1158,6 +1216,8 @@ def __init__(self, parent, fail_color='#FF8E8E', pass_color="#9FCC9F", skip_colo
11581216
self._gauge.Hide()
11591217
self._default_colour = parent.GetBackgroundColour()
11601218
self._foreground_colour = parent.GetForegroundColour()
1219+
self.active_status_bar = active_status_bar
1220+
self.caller = caller
11611221
self.fail_color = fail_color
11621222
self.pass_color = pass_color
11631223
self.skip_color = skip_color
@@ -1227,7 +1287,8 @@ def _update_message(self):
12271287
elapsed = time.time() - self._start_time
12281288
message = _("elapsed time: %s pass: %s skip: %s fail: %s") % (
12291289
self._seconds_to_string(elapsed), self._pass, self._skip, self._fail)
1230-
message += self._get_current_keyword_text()
1290+
current_keyword = self._get_current_keyword_text()
1291+
message += current_keyword
12311292
if self._fail > 0:
12321293
self.SetForegroundColour(self.get_visible_color(self.fail_color))
12331294
self.SetBackgroundColour(self.fail_color)
@@ -1249,6 +1310,8 @@ def _update_message(self):
12491310
self._label.SetForegroundColour(self._foreground_colour)
12501311
self._label.SetBackgroundColour(self._default_colour)
12511312
self._label.SetLabel(message)
1313+
if self.active_status_bar and self.caller:
1314+
self.caller.statusbar_message(current_keyword)
12521315
# not sure why this is required, but without it the background
12531316
# colors don't look right on Windows
12541317
self.Refresh()

src/robotide/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
#
1616
# Automatically generated by `tasks.py`.
1717

18-
VERSION = 'v2.2dev18'
18+
VERSION = 'v2.2dev19'

0 commit comments

Comments
 (0)