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
6 changes: 1 addition & 5 deletions src/testdoc/html/templates/v2/jinja_template_03.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,7 @@
<tr>
<td style="width: 10%; font-weight: bold;">🏷 Tags:</td>
<td style="text-align: left;">
{% if test.tags and test.tags is string %}
{{ test.tags }}
{% else %}
{{ test.tags | join(', ') }}
{% endif %}
{{ test.tags | join(', ') }}
</td>
</tr>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion src/testdoc/parser/modifier/sourceprefixmodifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
23 changes: 16 additions & 7 deletions src/testdoc/parser/testcaseparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def parse_test(self,
"name": test.name,
"doc": "<br>".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)
}
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down