Skip to content
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
2 changes: 2 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni
== https://github.com/robotframework/RIDE[Unreleased]

=== Added
- Added parsing of option *--name* or *-N* and *Name* setting, to allow running test suites with them set.

- Added indication of *private* keywords in Grid Editor, keywords will show in _Italic_, and with error
background, when they are used outside of Keywords section, or from different files.

Expand Down
2 changes: 2 additions & 0 deletions src/robotide/application/CHANGELOG.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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>
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">
Added parsing of option <span class="strong"><strong>--name</strong></span> or <span class="strong"><strong>-N</strong></span> and <span class="strong"><strong>Name</strong></span> setting, to allow running test suites with them set.
</li><li class="listitem">
Added indication of <span class="strong"><strong>private</strong></span> keywords in Grid Editor, keywords will show in <span class="emphasis"><em>Italic</em></span>, and with error
background, when they are used outside of Keywords section, or from different files.
</li><li class="listitem">
Expand Down
5 changes: 3 additions & 2 deletions src/robotide/application/releasenotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def set_content(self, html_win, content):

<p><a class="reference external" href="https://github.com/robotframework/RIDE/">RIDE (Robot Framework IDE)</a>
{VERSION} is a new release with some enhancements and bug fixes. The reference for valid arguments is
<a class="reference external" href="https://robotframework.org/">Robot Framework</a> current version, 7.3.1. However,
<a class="reference external" href="https://robotframework.org/">Robot Framework</a> current version, 7.3.2. However,
internal library code is originally based on version 3.1.2, but adapted for new versions.</p>
<ul class="simple">
<li>This version supports Python 3.8 up to 3.13 (and also tested on 3.14.a7 with wxPython 4.2.3).</li>
Expand All @@ -172,6 +172,7 @@ def set_content(self, html_win, content):
</ul>
<p><strong>New Features and Fixes Highlights</strong></p>
<ul class="simple">
<li>Added parsing of option <b>--name</b> or <b>-N</b> and <b>Name</b> setting, to allow running tests with them set.</li>
<li>Added indication of <b>private</b> keywords in Grid Editor, keywords will show in <em>Italic</em>, and with error
background, when they are used outside of Keywords section, or from different files.</li>
<li>Added indication of <b>private</b> keywords in Details pop-up for keywords with tag <b>robot:private</b> or name starting
Expand Down Expand Up @@ -255,7 +256,7 @@ def set_content(self, html_win, content):
<pre class="literal-block">python -m robotide.postinstall -install</pre>
<p>or</p>
<pre class="literal-block">ride_postinstall.py -install</pre>
<p>RIDE {VERSION} was released on 17/July/2025.</p>
<p>RIDE {VERSION} was released on 20/July/2025.</p>
<!-- <br/>
<h3>May The Fourth Be With You!</h3>
<h3>Celebrate the bank holiday, 10th June, Day of Portugal, Portuguese Communities and Camões!!</h3>
Expand Down
10 changes: 6 additions & 4 deletions src/robotide/contrib/testrunner/ArgsParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ class ArgsParser:

@staticmethod
def get_message_log_level(args, default='INFO'):
level = ArgsParser._get_arg_value('-L', '--loglevel',
args, default)
level = ArgsParser._get_arg_value('-L', '--loglevel', args, default)
level_list = level.upper().split(':')
try:
min_level = LOG_LEVELS[level_list[0]] or LOG_LEVELS[default]
Expand All @@ -49,8 +48,11 @@ def get_message_log_level(args, default='INFO'):

@staticmethod
def get_output_directory(args, default):
return ArgsParser._get_arg_value('-d', '--outputdir',
args, default)
return ArgsParser._get_arg_value('-d', '--outputdir', args, default)

@staticmethod
def get_named_suite(args, default=''):
return ArgsParser._get_arg_value('-N', '--name', args, default)

@staticmethod
def _get_arg_value(short_name, full_name, source, default):
Expand Down
14 changes: 12 additions & 2 deletions src/robotide/contrib/testrunner/CommandArgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,20 @@ def with_output_directory(self, output_directory):
self._output_directory = output_directory
return self

def with_runnable_tests(self, tests):
def with_runnable_tests(self, tests, named_suite=''):
def fix_name(name):
if named_suite:
if '.' in name:
l_name = name.split('.')
l_name[0] = named_suite
return '.'.join(l_name)
else:
return named_suite
return name

self._tests_to_run.clear()
for suite, test in tests:
self._tests_to_run += ['--suite', suite, '--test', test]
self._tests_to_run += ['--suite', fix_name(suite), '--test', fix_name(test)]
return self

def without_console_color(self, without_colors=True):
Expand Down
11 changes: 11 additions & 0 deletions src/robotide/contrib/testrunner/testrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,19 @@ def __init__(self, project):
self.profiles = {}
self._pause_longname = None
self._pause_testname = None
self._named_suite = ''
self._suite_name = None

def enable(self, result_handler):
self._start_listener_server(result_handler)

def add_profile(self, name, item):
self.profiles[name] = item

def set_named_suite(self, name):
self._suite_name = self._project.suite.name
self._named_suite = name

def get_profile(self, name):
return self.profiles[name]

Expand Down Expand Up @@ -125,6 +131,9 @@ def _result_handler(self, event, *args):

def _get_test_controller(self, longname, testname=None):
ret = self._project.find_controller_by_longname(longname, testname)
if not ret and self._named_suite:
ret = self._project.find_controller_by_longname(longname.replace(self._named_suite, self._suite_name)
.strip('.'), testname)
return ret

def clear_server(self):
Expand Down Expand Up @@ -186,6 +195,8 @@ def is_running(self):
def command_ended(self):
self._results.set_stopped(None)
self._process = None
self._named_suite = ''
self._suite_name = None


# The following two classes implement a small line-buffered socket
Expand Down
21 changes: 12 additions & 9 deletions src/robotide/contrib/testrunner/testrunnerplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def __init__(self, application=None):
self._initmemory = None
self._limitmemory = None # This will be +80%
self._maxmemmsg = None
self._named_suite = ''
self.active_status_bar = self.__getattr__('active_status_bar')
self.use_colors = self.__getattr__('use colors')
self.fail_color = self.__getattr__('fail color')
Expand All @@ -193,6 +194,10 @@ def _names_to_run(self):
map(lambda ctrl: (ctrl.datafile_controller.longname, ctrl.longname),
self._selected_tests))

def named_suite(self, args):
self._named_suite = ArgsParser.get_named_suite(args)
return self._named_suite

def _register_shortcuts(self):
self.register_shortcut('CtrlCmd-C', self._copy_from_log_ctrls)
self.register_shortcut('CtrlCmd-L', self.on_show_log)
Expand Down Expand Up @@ -410,7 +415,7 @@ def _create_command_args(self, profile_command_args, log_level='INFO', use_color
.with_python_path(self.global_settings.get('pythonpath', None)) \
.with_console_width(self._get_console_width()) \
.without_console_color(not use_colors) \
.with_runnable_tests(self._names_to_run) \
.with_runnable_tests(self._names_to_run, self.named_suite(profile_command_args)) \
.build()

def _save_command_args_in_file(self, args):
Expand All @@ -430,16 +435,14 @@ def _initialize_variables_for_running(self, profile_settings, args):
self._report_file = self._log_file = None
self._log_message_queue = Queue()

self._min_log_level_number = \
ArgsParser.get_message_log_level(args)
self._min_log_level_number = ArgsParser.get_message_log_level(args)

self._logs_directory = ArgsParser.get_output_directory(args, self._default_output_dir)

self._logs_directory = \
ArgsParser.get_output_directory(args, self._default_output_dir)
self._test_runner.set_named_suite(self.named_suite(args)) # When no tests selected, to have execution status

console_log_name = \
SettingsParser.get_console_log_name(profile_settings)
self._console_log = '' if not console_log_name \
else os.path.join(self._logs_directory, console_log_name)
console_log_name = SettingsParser.get_console_log_name(profile_settings)
self._console_log = '' if not console_log_name else os.path.join(self._logs_directory, console_log_name)

def _get_current_working_dir(self, profile):
if profile.name == runprofiles.CustomScriptProfile.name:
Expand Down
6 changes: 6 additions & 0 deletions src/robotide/lib/robot/parsing/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ def _table_is_allowed(self, table):

@property
def name(self):
# if self.has_setting_table():
# print(f"DEBUG: model.py _TestData name HAS SETTING_TABLE")
suite_name = self.setting_table.suite_name
if suite_name and suite_name.value:
# print(f"DEBUG: model.py _TestData name RETURN SUITE_NAME={suite_name.value}")
return suite_name.value
return self._format_name(self._get_basename()) if self.source else None

@property
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.2dev34'
VERSION = 'v2.2dev35'
14 changes: 14 additions & 0 deletions utest/contrib/testrunner/test_args_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,20 @@ def test_get_output_directory_long(self):
result = ArgsParser.get_output_directory(args, DEFAULT_LOGS)
self.assertEqual('/temp/report', result)

def test_get_named_suite_short(self):
args = ['-N', 'My Named Suite',
'--suite', 'suite_name_1',
'--test', 'test_1']
result = ArgsParser.get_named_suite(args)
self.assertEqual('My Named Suite', result)

def test_get_named_suite_long(self):
args = ['--name', 'My Named Suite',
'--suite', 'suite_name_1',
'--test', 'test_1']
result = ArgsParser.get_named_suite(args)
self.assertEqual('My Named Suite', result)


if __name__ == '__main__':
unittest.main()