From 170db9fb99d4055fc2ef5ef412d10df69bf62352 Mon Sep 17 00:00:00 2001 From: Yinling He Date: Wed, 5 Jun 2024 17:08:45 +0800 Subject: [PATCH 1/3] Fix error when running non-English robot case files pabot use TestSuiteBuilder to parse cases before executing. For cases uses other languages, we need to pass language to TestSuiteBuilder so it can handle properly. --- src/pabot/pabot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pabot/pabot.py b/src/pabot/pabot.py index fb95ade5..72342f06 100644 --- a/src/pabot/pabot.py +++ b/src/pabot/pabot.py @@ -1152,13 +1152,17 @@ def generate_suite_names_with_builder(outs_dir, datasources, options): settings = RobotSettings(opts) # Note: first argument (included_suites) is deprecated from RobotFramework 6.1 - if ROBOT_VERSION < "6.1": + if ROBOT_VERSION < "6.0": builder = TestSuiteBuilder( settings["SuiteNames"], settings.extension, rpa=settings.rpa ) + elif ROBOT_VERSION < "6.1": + builder = TestSuiteBuilder( + settings["SuiteNames"], settings.extension, rpa=settings.rpa, lang=opts["language"] + ) else: builder = TestSuiteBuilder( - included_extensions=settings.extension, rpa=settings.rpa + included_extensions=settings.extension, rpa=settings.rpa, lang=opts["language"] ) suite = builder.build(*datasources) settings.rpa = builder.rpa From 1aefdd6885de17101718a585f980b4b53d032e65 Mon Sep 17 00:00:00 2001 From: Mikko Korpela Date: Sat, 30 Nov 2024 14:06:00 +0200 Subject: [PATCH 2/3] lang option --- src/pabot/pabot.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/pabot/pabot.py b/src/pabot/pabot.py index e3f19f80..0e71bc84 100644 --- a/src/pabot/pabot.py +++ b/src/pabot/pabot.py @@ -1152,18 +1152,15 @@ def generate_suite_names_with_builder(outs_dir, datasources, options): settings = RobotSettings(opts) # Note: first argument (included_suites) is deprecated from RobotFramework 6.1 - if ROBOT_VERSION < "6.0": + if ROBOT_VERSION >= "6.1": builder = TestSuiteBuilder( - settings["SuiteNames"], settings.extension, rpa=settings.rpa - ) - elif ROBOT_VERSION < "6.1": - builder = TestSuiteBuilder( - settings["SuiteNames"], settings.extension, rpa=settings.rpa, lang=opts["language"] + included_extensions=settings.extension, rpa=settings.rpa, lang=opts["language"] ) else: builder = TestSuiteBuilder( - included_extensions=settings.extension, rpa=settings.rpa, lang=opts["language"] - ) + settings["SuiteNames"], settings.extension, rpa=settings.rpa + ) + suite = builder.build(*datasources) settings.rpa = builder.rpa suite.configure(**settings.suite_config) From 7f34087ee79e086f0a195b90fa1ff55433c380a6 Mon Sep 17 00:00:00 2001 From: Mikko Korpela Date: Sat, 30 Nov 2024 14:14:15 +0200 Subject: [PATCH 3/3] fix case where lang is empty --- src/pabot/pabot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pabot/pabot.py b/src/pabot/pabot.py index 0e71bc84..d035f30f 100644 --- a/src/pabot/pabot.py +++ b/src/pabot/pabot.py @@ -1154,7 +1154,7 @@ def generate_suite_names_with_builder(outs_dir, datasources, options): # Note: first argument (included_suites) is deprecated from RobotFramework 6.1 if ROBOT_VERSION >= "6.1": builder = TestSuiteBuilder( - included_extensions=settings.extension, rpa=settings.rpa, lang=opts["language"] + included_extensions=settings.extension, rpa=settings.rpa, lang=opts.get("language") ) else: builder = TestSuiteBuilder(