diff --git a/src/testdoc/html/templates/v2/jinja_template_03.html b/src/testdoc/html/templates/v2/jinja_template_03.html index 86fc5f1..65a231a 100644 --- a/src/testdoc/html/templates/v2/jinja_template_03.html +++ b/src/testdoc/html/templates/v2/jinja_template_03.html @@ -77,11 +77,7 @@ 🏷 Tags: - {% if test.tags and test.tags is string %} - {{ test.tags }} - {% else %} - {{ test.tags | join(', ') }} - {% endif %} + {{ test.tags | join(', ') }} {% endif %} diff --git a/src/testdoc/parser/modifier/sourceprefixmodifier.py b/src/testdoc/parser/modifier/sourceprefixmodifier.py index 7219d38..967ece2 100644 --- a/src/testdoc/parser/modifier/sourceprefixmodifier.py +++ b/src/testdoc/parser/modifier/sourceprefixmodifier.py @@ -85,7 +85,7 @@ def _convert_to_gitlab_url(self, file_path, prefix): git_root = self._get_git_root(file_path) git_branch = self._get_git_branch(git_root) if not git_root: - return "GitLink error" + return "Unable to fetch GitLab URL!" rel_path = os.path.relpath(file_path, git_root).replace(os.sep, "/") return prefix.rstrip("/") + "/-/blob/" + git_branch + "/" + rel_path diff --git a/src/testdoc/parser/testcaseparser.py b/src/testdoc/parser/testcaseparser.py index 54a266e..1293a41 100644 --- a/src/testdoc/parser/testcaseparser.py +++ b/src/testdoc/parser/testcaseparser.py @@ -19,7 +19,7 @@ def parse_test(self, "name": test.name, "doc": "
".join(line.replace("\\n","") for line in test.doc.splitlines() if line.strip()) if test.doc else "No Test Case Documentation Available", - "tags": test.tags if test.tags else "No Tags Configured", + "tags": test.tags if test.tags else ["No Tags Configured"], "source": str(test.source), "keywords": self._keyword_parser(test.body) } @@ -47,7 +47,7 @@ def _keyword_parser(self, test_body: Body): # Fallback in case of no keywords if len(_keyword_object) == 0: - return "No Keyword Calls in Test" + return ["No Keyword Calls in Test"] return _keyword_object def _handle_keyword_types(self, kw: Keyword, indent: int = 0): @@ -105,6 +105,19 @@ def _handle_keyword_types(self, kw: Keyword, indent: int = 0): result.extend(self._handle_keyword_types(subkw, indent=indent+1)) result.append(f"{_indent}END") + # GROUP loop + elif kw_type == "GROUP": + header = f"{_indent}GROUP" + if not kw.name == "": + header += f"{_sd}{kw.name}" + if hasattr(kw, 'condition') and kw.condition: + header += f" {kw.condition}" + result.append(header) + if hasattr(kw, 'body'): + for subkw in kw.body: + result.extend(self._handle_keyword_types(subkw, indent=indent+1)) + result.append(f"{_indent}END") + # WHILE loop elif kw_type == "WHILE": header = f"{_indent}WHILE" @@ -134,13 +147,9 @@ def _handle_keyword_types(self, kw: Keyword, indent: int = 0): elif kw_type in ("BREAK", "CONTINUE", "RETURN", "ERROR"): entry = f"{_indent}{kw_type}" if hasattr(kw, 'values') and kw.values: - entry += f" {' '.join(kw.values)}" + entry += f" {_sd.join(kw.values)}" result.append(entry) - # Other types - elif kw_type in ("COMMENT", "EMPTY"): - pass - # Unknown types elif hasattr(kw, 'body'): for subkw in kw.body: